@@ -32,7 +32,7 @@ |
||
32 | 32 | # print widghets that are not yet selected |
33 | 33 | $m = 0; |
34 | 34 | foreach($widgets as $k=>$w) { |
35 | - if(!in_array($k, $uwidgets)) { |
|
35 | + if(!in_array($k, $uwidgets)) { |
|
36 | 36 | $wtmp = (array) $widgets[$k]; |
37 | 37 | # size fix |
38 | 38 | if(strlen($wtmp['wsize'])==0) { $wtmp['wsize']=6; } |
@@ -136,7 +136,10 @@ |
||
136 | 136 | <div class="pFooter"> |
137 | 137 | <div class="btn-group"> |
138 | 138 | <button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button> |
139 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="editNameservers"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } else if ($_POST['action']=="delete") { print "fa-trash-o"; } else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
139 | + <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } |
|
140 | +else { print "btn-success"; } ?>" id="editNameservers"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } |
|
141 | +else if ($_POST['action']=="delete") { print "fa-trash-o"; } |
|
142 | +else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
140 | 143 | </div> |
141 | 144 | <!-- result --> |
142 | 145 | <div class="nameserverManagementEditResult"></div> |
@@ -40,14 +40,20 @@ discard block |
||
40 | 40 | <!-- name --> |
41 | 41 | <tr> |
42 | 42 | <td><?php print _('Title'); ?></td> |
43 | - <td><input class="form-control input-sm input-w-250" type="text" name="wtitle" value="<?php print @$w['wtitle']; ?>" <?php if($_POST['action'] == "delete") print "readonly"; ?>></td> |
|
43 | + <td><input class="form-control input-sm input-w-250" type="text" name="wtitle" value="<?php print @$w['wtitle']; ?>" <?php if($_POST['action'] == "delete") { |
|
44 | + print "readonly"; |
|
45 | +} |
|
46 | +?>></td> |
|
44 | 47 | </tr> |
45 | 48 | |
46 | 49 | <!-- description --> |
47 | 50 | <tr> |
48 | 51 | <td><?php print _('Description'); ?></td> |
49 | 52 | <td> |
50 | - <input class="form-control input-sm input-w-250" type="text" name="wdescription" value="<?php print @$w['wdescription']; ?>" <?php if($_POST['action'] == "delete") print "readonly"; ?>> |
|
53 | + <input class="form-control input-sm input-w-250" type="text" name="wdescription" value="<?php print @$w['wdescription']; ?>" <?php if($_POST['action'] == "delete") { |
|
54 | + print "readonly"; |
|
55 | +} |
|
56 | +?>> |
|
51 | 57 | |
52 | 58 | <input type="hidden" name="wid" value="<?php print $_POST['wid']; ?>"> |
53 | 59 | <input type="hidden" name="action" value="<?php print $_POST['action']; ?>"> |
@@ -58,13 +64,19 @@ discard block |
||
58 | 64 | <!-- File --> |
59 | 65 | <tr> |
60 | 66 | <td><?php print _('File'); ?></td> |
61 | - <td><input class="form-control input-sm input-w-250" type="text" name="wfile" value="<?php print @$w['wfile']; ?>.php" <?php if($_POST['action'] == "delete") print "readonly"; ?>></td> |
|
67 | + <td><input class="form-control input-sm input-w-250" type="text" name="wfile" value="<?php print @$w['wfile']; ?>.php" <?php if($_POST['action'] == "delete") { |
|
68 | + print "readonly"; |
|
69 | +} |
|
70 | +?>></td> |
|
62 | 71 | </tr> |
63 | 72 | |
64 | 73 | <!-- params --> |
65 | 74 | <tr> |
66 | 75 | <td><?php print _('Parameters'); ?></td> |
67 | - <td><input class="form-control input-sm input-w-250" type="text" name="wparams" value="<?php print @$w['wparams']; ?>" <?php if($_POST['action'] == "delete") print "readonly"; ?>></td> |
|
76 | + <td><input class="form-control input-sm input-w-250" type="text" name="wparams" value="<?php print @$w['wparams']; ?>" <?php if($_POST['action'] == "delete") { |
|
77 | + print "readonly"; |
|
78 | +} |
|
79 | +?>></td> |
|
68 | 80 | </tr> |
69 | 81 | |
70 | 82 | <!-- Admin --> |
@@ -72,8 +84,14 @@ discard block |
||
72 | 84 | <td><?php print _('Admin only'); ?></td> |
73 | 85 | <td> |
74 | 86 | <select name="wadminonly" class="form-control input-sm input-w-auto"> |
75 | - <option value="no" <?php if(@$w['wadminonly']=='no') print "selected='selected'"; ?>><?php print _('No'); ?></option> |
|
76 | - <option value="yes" <?php if(@$w['wadminonly']=='yes') print "selected='selected'"; ?>><?php print _('Yes'); ?></option> |
|
87 | + <option value="no" <?php if(@$w['wadminonly']=='no') { |
|
88 | + print "selected='selected'"; |
|
89 | +} |
|
90 | +?>><?php print _('No'); ?></option> |
|
91 | + <option value="yes" <?php if(@$w['wadminonly']=='yes') { |
|
92 | + print "selected='selected'"; |
|
93 | +} |
|
94 | +?>><?php print _('Yes'); ?></option> |
|
77 | 95 | |
78 | 96 | </select> |
79 | 97 | </td> |
@@ -84,8 +102,14 @@ discard block |
||
84 | 102 | <td><?php print _('Active'); ?></td> |
85 | 103 | <td> |
86 | 104 | <select name="wactive" class="form-control input-sm input-w-auto"> |
87 | - <option value="no" <?php if(@$w['wactive']=='no') print "selected='selected'"; ?>><?php print _('No'); ?></option> |
|
88 | - <option value="yes" <?php if(@$w['wactive']=='yes') print "selected='selected'"; ?>><?php print _('Yes'); ?></option> |
|
105 | + <option value="no" <?php if(@$w['wactive']=='no') { |
|
106 | + print "selected='selected'"; |
|
107 | +} |
|
108 | +?>><?php print _('No'); ?></option> |
|
109 | + <option value="yes" <?php if(@$w['wactive']=='yes') { |
|
110 | + print "selected='selected'"; |
|
111 | +} |
|
112 | +?>><?php print _('Yes'); ?></option> |
|
89 | 113 | |
90 | 114 | </select> |
91 | 115 | </td> |
@@ -96,8 +120,14 @@ discard block |
||
96 | 120 | <td><?php print _('Link to page'); ?></td> |
97 | 121 | <td> |
98 | 122 | <select name="whref" class="form-control input-sm input-w-auto"> |
99 | - <option value="no" <?php if(@$w['whref']=='no') print "selected='selected'"; ?>><?php print _('No'); ?></option> |
|
100 | - <option value="yes" <?php if(@$w['whref']=='yes') print "selected='selected'"; ?>><?php print _('Yes'); ?></option> |
|
123 | + <option value="no" <?php if(@$w['whref']=='no') { |
|
124 | + print "selected='selected'"; |
|
125 | +} |
|
126 | +?>><?php print _('No'); ?></option> |
|
127 | + <option value="yes" <?php if(@$w['whref']=='yes') { |
|
128 | + print "selected='selected'"; |
|
129 | +} |
|
130 | +?>><?php print _('Yes'); ?></option> |
|
101 | 131 | |
102 | 132 | </select> |
103 | 133 | </td> |
@@ -108,10 +138,22 @@ discard block |
||
108 | 138 | <td><?php print _('Widget size'); ?></td> |
109 | 139 | <td> |
110 | 140 | <select name="wsize" class="form-control input-sm input-w-auto"> |
111 | - <option value="4" <?php if(@$w['wsize']=='4') print "selected='selected'"; ?>>25%</option> |
|
112 | - <option value="6" <?php if(@$w['wsize']=='6') print "selected='selected'"; ?>>50%</option> |
|
113 | - <option value="8" <?php if(@$w['wsize']=='8') print "selected='selected'"; ?>>75%</option> |
|
114 | - <option value="12" <?php if(@$w['wsize']=='12') print "selected='selected'"; ?>>100%</option> |
|
141 | + <option value="4" <?php if(@$w['wsize']=='4') { |
|
142 | + print "selected='selected'"; |
|
143 | +} |
|
144 | +?>>25%</option> |
|
145 | + <option value="6" <?php if(@$w['wsize']=='6') { |
|
146 | + print "selected='selected'"; |
|
147 | +} |
|
148 | +?>>50%</option> |
|
149 | + <option value="8" <?php if(@$w['wsize']=='8') { |
|
150 | + print "selected='selected'"; |
|
151 | +} |
|
152 | +?>>75%</option> |
|
153 | + <option value="12" <?php if(@$w['wsize']=='12') { |
|
154 | + print "selected='selected'"; |
|
155 | +} |
|
156 | +?>>100%</option> |
|
115 | 157 | </select> |
116 | 158 | </td> |
117 | 159 | </tr> |
@@ -126,7 +168,10 @@ discard block |
||
126 | 168 | <div class="pFooter"> |
127 | 169 | <div class="btn-group"> |
128 | 170 | <button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button> |
129 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="widgetEditSubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } else if ($_POST['action']=="delete") { print "fa-trash-o"; } else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
171 | + <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } |
|
172 | +else { print "btn-success"; } ?>" id="widgetEditSubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } |
|
173 | +else if ($_POST['action']=="delete") { print "fa-trash-o"; } |
|
174 | +else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
130 | 175 | </div> |
131 | 176 | |
132 | 177 | <!-- Result --> |
@@ -73,8 +73,7 @@ |
||
73 | 73 | print trim(implode(";", array_filter($membership))); |
74 | 74 | } |
75 | 75 | |
76 | -} |
|
77 | -catch (adLDAPException $e) { |
|
76 | +} catch (adLDAPException $e) { |
|
78 | 77 | $Result->show("danger", $e->getMessage(), true); |
79 | 78 | } |
80 | 79 | ?> |
81 | 80 | \ No newline at end of file |
@@ -58,8 +58,7 @@ discard block |
||
58 | 58 | $userinfo = $adldap->user()->info("$_POST[dname]*", array("*"),false,$server->type); |
59 | 59 | |
60 | 60 | //echo $adldap->getLastError(); |
61 | -} |
|
62 | -catch (adLDAPException $e) { |
|
61 | +} catch (adLDAPException $e) { |
|
63 | 62 | $Result->show("danger", $e->getMessage(), true); |
64 | 63 | } |
65 | 64 | |
@@ -74,7 +73,8 @@ discard block |
||
74 | 73 | print "<li>"._('Invalid baseDN setting for AD')."</li>"; |
75 | 74 | print "<li>"._('AD account does not have enough privileges for search')."</li>"; |
76 | 75 | print "</div>"; |
77 | -} else { |
|
76 | +} |
|
77 | +else { |
|
78 | 78 | print _(" Following users were found").": ($userinfo[count]):<hr>"; |
79 | 79 | |
80 | 80 | print "<table class='table table-striped'>"; |
@@ -8,7 +8,7 @@ |
||
8 | 8 | $User->check_user_session(); |
9 | 9 | |
10 | 10 | // switch user |
11 | -if(@$_GET['subnetId']=="switch"){ |
|
11 | +if(@$_GET['subnetId']=="switch") { |
|
12 | 12 | $_SESSION['realipamusername'] = $_SESSION['ipamusername']; |
13 | 13 | $_SESSION['ipamusername'] = $_GET['sPage']; |
14 | 14 | print '<script>window.location.href = "'.create_link(null).'";</script>'; |
@@ -161,7 +161,7 @@ |
||
161 | 161 | print "/"; |
162 | 162 | } |
163 | 163 | //booleans |
164 | - elseif($field['type']=="tinyint(1)") { |
|
164 | + elseif($field['type']=="tinyint(1)") { |
|
165 | 165 | if($user->$key == "0") { print _("No"); } |
166 | 166 | elseif($user->$key == "1") { print _("Yes"); } |
167 | 167 | } |
@@ -55,7 +55,8 @@ discard block |
||
55 | 55 | //username > 8 chars |
56 | 56 | if ($auth_method->type=="local") { |
57 | 57 | if(strlen($_POST['username'])<6) { $Result->show("danger", _("Username must be at least 6 characters long!"), true); } |
58 | - } else { |
|
58 | + } |
|
59 | + else { |
|
59 | 60 | if(strlen($_POST['username'])==0) { $Result->show("danger", _("Username must be at least 1 character long!"), true); } |
60 | 61 | } |
61 | 62 | //check duplicate |
@@ -112,7 +113,8 @@ discard block |
||
112 | 113 | # set groups user belongs to |
113 | 114 | if($_POST['role']=="Administrator") { |
114 | 115 | $values['groups'] = null; |
115 | -} else { |
|
116 | +} |
|
117 | +else { |
|
116 | 118 | foreach($_POST as $key=>$post) { |
117 | 119 | if(substr($key, 0,5) == "group") { |
118 | 120 | $group[substr($key, 5)] = substr($key, 5); |
@@ -85,7 +85,10 @@ discard block |
||
85 | 85 | <!-- username --> |
86 | 86 | <tr> |
87 | 87 | <td><?php print _('Username'); ?></td> |
88 | - <td><input type="text" class="form-control input-sm" name="username" value="<?php print @$user['username']; ?>" <?php if($_POST['action']=="edit"||$_POST['action']=="delete") print 'readonly'; ?>></td> |
|
88 | + <td><input type="text" class="form-control input-sm" name="username" value="<?php print @$user['username']; ?>" <?php if($_POST['action']=="edit"||$_POST['action']=="delete") { |
|
89 | + print 'readonly'; |
|
90 | +} |
|
91 | +?>></td> |
|
89 | 92 | <td class="info2"> |
90 | 93 | <a class='btn btn-xs btn-default adsearchuser' rel='tooltip' title='Search AD for user details'><i class='fa fa-search'></i></a> |
91 | 94 | <?php print _('Enter username'); ?> |
@@ -104,8 +107,14 @@ discard block |
||
104 | 107 | <td><?php print _('User role'); ?></td> |
105 | 108 | <td> |
106 | 109 | <select name="role" class="form-control input-sm input-w-auto"> |
107 | - <option value="Administrator" <?php if (@$user['role'] == "Administrator") print "selected"; ?>><?php print _('Administrator'); ?></option> |
|
108 | - <option value="User" <?php if (@$user['role'] == "User" || $_POST['action'] == "add") print "selected"; ?>><?php print _('Normal User'); ?></option> |
|
110 | + <option value="Administrator" <?php if (@$user['role'] == "Administrator") { |
|
111 | + print "selected"; |
|
112 | +} |
|
113 | +?>><?php print _('Administrator'); ?></option> |
|
114 | + <option value="User" <?php if (@$user['role'] == "User" || $_POST['action'] == "add") { |
|
115 | + print "selected"; |
|
116 | +} |
|
117 | +?>><?php print _('Normal User'); ?></option> |
|
109 | 118 | </select> |
110 | 119 | |
111 | 120 | |
@@ -147,7 +156,10 @@ discard block |
||
147 | 156 | </tbody> |
148 | 157 | |
149 | 158 | <!-- password --> |
150 | - <tbody id="user_password" <?php if(@$user['authMethod']!="1" && isset($user['authMethod'])) print "style='display:none'"; ?>> |
|
159 | + <tbody id="user_password" <?php if(@$user['authMethod']!="1" && isset($user['authMethod'])) { |
|
160 | + print "style='display:none'"; |
|
161 | +} |
|
162 | +?>> |
|
151 | 163 | |
152 | 164 | <tr class="password"> |
153 | 165 | <td><?php print _('Password'); ?></td> |
@@ -197,19 +209,26 @@ discard block |
||
197 | 209 | <!-- send notification mail --> |
198 | 210 | <tr> |
199 | 211 | <td><?php print _('Notification'); ?></td> |
200 | - <td><input type="checkbox" name="notifyUser" value="on" <?php if($_POST['action'] == "add") { print 'checked'; } else if($_POST['action'] == "delete") { print 'disabled="disabled"';} ?>></td> |
|
212 | + <td><input type="checkbox" name="notifyUser" value="on" <?php if($_POST['action'] == "add") { print 'checked'; } |
|
213 | +else if($_POST['action'] == "delete") { print 'disabled="disabled"';} ?>></td> |
|
201 | 214 | <td class="info2"><?php print _('Send notification email to user with account details'); ?></td> |
202 | 215 | </tr> |
203 | 216 | </tbody> |
204 | 217 | |
205 | 218 | <!-- mailNotify --> |
206 | - <tbody id="user_notifications" <?php if(@$user['role']!="Administrator") print "style='display:none'"; ?>> |
|
219 | + <tbody id="user_notifications" <?php if(@$user['role']!="Administrator") { |
|
220 | + print "style='display:none'"; |
|
221 | +} |
|
222 | +?>> |
|
207 | 223 | <tr> |
208 | 224 | <td><?php print _('Mail State changes'); ?></td> |
209 | 225 | <td> |
210 | 226 | <select name="mailNotify" class="form-control input-sm input-w-auto"> |
211 | 227 | <option value="No"><?php print _('No'); ?></option> |
212 | - <option value="Yes" <?php if (@$user['mailNotify'] == "Yes") print "selected='selected'"; ?>><?php print _('Yes'); ?></option> |
|
228 | + <option value="Yes" <?php if (@$user['mailNotify'] == "Yes") { |
|
229 | + print "selected='selected'"; |
|
230 | +} |
|
231 | +?>><?php print _('Yes'); ?></option> |
|
213 | 232 | </select> |
214 | 233 | |
215 | 234 | |
@@ -223,7 +242,10 @@ discard block |
||
223 | 242 | <td> |
224 | 243 | <select name="mailChangelog" class="form-control input-sm input-w-auto"> |
225 | 244 | <option value="No"><?php print _('No'); ?></option> |
226 | - <option value="Yes" <?php if (@$user['mailChangelog'] == "Yes") print "selected='selected'"; ?>><?php print _('Yes'); ?></option> |
|
245 | + <option value="Yes" <?php if (@$user['mailChangelog'] == "Yes") { |
|
246 | + print "selected='selected'"; |
|
247 | +} |
|
248 | +?>><?php print _('Yes'); ?></option> |
|
227 | 249 | </select> |
228 | 250 | |
229 | 251 | |
@@ -276,7 +298,10 @@ discard block |
||
276 | 298 | <tr> |
277 | 299 | <td><?php print _("PowerDNS"); ?></td> |
278 | 300 | <td> |
279 | - <input type="checkbox" class="input-switch" value="Yes" name="pdns" <?php if(@$user->pdns == "Yes") print 'checked'; ?>> |
|
301 | + <input type="checkbox" class="input-switch" value="Yes" name="pdns" <?php if(@$user->pdns == "Yes") { |
|
302 | + print 'checked'; |
|
303 | +} |
|
304 | +?>> |
|
280 | 305 | </td> |
281 | 306 | <td class="info2"><?php print _('Select to allow user to create DNS records'); ?></td> |
282 | 307 | </tr> |
@@ -390,7 +415,10 @@ discard block |
||
390 | 415 | <div class="pFooter"> |
391 | 416 | <div class="btn-group"> |
392 | 417 | <button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button> |
393 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="editUserSubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } else if ($_POST['action']=="delete") { print "fa-trash-o"; } else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
418 | + <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } |
|
419 | +else { print "btn-success"; } ?>" id="editUserSubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } |
|
420 | +else if ($_POST['action']=="delete") { print "fa-trash-o"; } |
|
421 | +else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
394 | 422 | </div> |
395 | 423 | |
396 | 424 | <!-- Result --> |