@@ -9,18 +9,18 @@ discard block |
||
9 | 9 | |
10 | 10 | # ID must be numeric */ |
11 | 11 | if($_POST['action']!="add") { |
12 | - if(!is_numeric($_POST['id'])) { $Result->show("danger", _("Invalid ID"), true, true); } |
|
12 | + if(!is_numeric($_POST['id'])) { $Result->show("danger", _("Invalid ID"), true, true); } |
|
13 | 13 | |
14 | - # feth method settings |
|
15 | - $method_settings = $Admin->fetch_object ("usersAuthMethod", "id", $_POST['id']); |
|
16 | - $method_settings->params = json_decode($method_settings->params); |
|
14 | + # feth method settings |
|
15 | + $method_settings = $Admin->fetch_object ("usersAuthMethod", "id", $_POST['id']); |
|
16 | + $method_settings->params = json_decode($method_settings->params); |
|
17 | 17 | } |
18 | 18 | else { |
19 | - $method_settings = new StdClass (); |
|
20 | - # set default values |
|
21 | - @$method_settings->params->hostname = "localhost"; |
|
22 | - $method_settings->params->port = 1812; |
|
23 | - $method_settings->params->timeout = 2; |
|
19 | + $method_settings = new StdClass (); |
|
20 | + # set default values |
|
21 | + @$method_settings->params->hostname = "localhost"; |
|
22 | + $method_settings->params->port = 1812; |
|
23 | + $method_settings->params->timeout = 2; |
|
24 | 24 | |
25 | 25 | } |
26 | 26 | |
@@ -105,12 +105,12 @@ discard block |
||
105 | 105 | <td> |
106 | 106 | <select name="timeout" class="form-control input-w-auto"> |
107 | 107 | <?php |
108 | - $values = array(1,2,3,5,10); |
|
109 | - foreach($values as $v) { |
|
110 | - if($v==@$method_settings->params->timeout) { print "<option value='$v' selected=selected>$v</option>"; } |
|
111 | - else { print "<option value='$v' >$v</option>"; } |
|
112 | - } |
|
113 | - ?> |
|
108 | + $values = array(1,2,3,5,10); |
|
109 | + foreach($values as $v) { |
|
110 | + if($v==@$method_settings->params->timeout) { print "<option value='$v' selected=selected>$v</option>"; } |
|
111 | + else { print "<option value='$v' >$v</option>"; } |
|
112 | + } |
|
113 | + ?> |
|
114 | 114 | </select> |
115 | 115 | </td> |
116 | 116 | <td class="base_dn info2"> |
@@ -122,12 +122,12 @@ discard block |
||
122 | 122 | </form> |
123 | 123 | |
124 | 124 | <?php |
125 | - # check for socket support ! |
|
126 | - if(!in_array("sockets", get_loaded_extensions())) { |
|
127 | - $Log->write( "Radius login", "php Socket extension missing!", 2 ); |
|
128 | - $Result->show("danger", _("php Socket extension missing!"), false); |
|
129 | - } |
|
130 | - ?> |
|
125 | + # check for socket support ! |
|
126 | + if(!in_array("sockets", get_loaded_extensions())) { |
|
127 | + $Log->write( "Radius login", "php Socket extension missing!", 2 ); |
|
128 | + $Result->show("danger", _("php Socket extension missing!"), false); |
|
129 | + } |
|
130 | + ?> |
|
131 | 131 | </div> |
132 | 132 | |
133 | 133 | |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | </div> |
140 | 140 | |
141 | 141 | <?php |
142 | - # check for mathing users |
|
143 | - if($_POST['action']=="delete") { |
|
144 | - $users = $Admin->fetch_multiple_objects ("users", "authMethod", @$method_settings->id); |
|
145 | - if($users!==false) { |
|
146 | - $Result->show("warning", sizeof($users)._(" users have this method for logging in. They will be reset to local auth!"), false); |
|
147 | - } |
|
148 | - } |
|
149 | - ?> |
|
142 | + # check for mathing users |
|
143 | + if($_POST['action']=="delete") { |
|
144 | + $users = $Admin->fetch_multiple_objects ("users", "authMethod", @$method_settings->id); |
|
145 | + if($users!==false) { |
|
146 | + $Result->show("warning", sizeof($users)._(" users have this method for logging in. They will be reset to local auth!"), false); |
|
147 | + } |
|
148 | + } |
|
149 | + ?> |
|
150 | 150 | |
151 | 151 | <!-- Result --> |
152 | 152 | <div class="editAuthMethodResult"></div> |
@@ -9,19 +9,19 @@ discard block |
||
9 | 9 | |
10 | 10 | # ID must be numeric */ |
11 | 11 | if($_POST['action']!="add") { |
12 | - if(!is_numeric($_POST['id'])) { $Result->show("danger", _("Invalid ID"), true, true); } |
|
12 | + if(!is_numeric($_POST['id'])) { $Result->show("danger", _("Invalid ID"), true, true); } |
|
13 | 13 | |
14 | - # feth method settings |
|
15 | - $method_settings = $Admin->fetch_object ("usersAuthMethod", "id", $_POST['id']); |
|
16 | - $method_settings->params = json_decode($method_settings->params); |
|
14 | + # feth method settings |
|
15 | + $method_settings = $Admin->fetch_object ("usersAuthMethod", "id", $_POST['id']); |
|
16 | + $method_settings->params = json_decode($method_settings->params); |
|
17 | 17 | } |
18 | 18 | else { |
19 | - $method_settings = new StdClass (); |
|
20 | - # set default values |
|
21 | - @$method_settings->params->domain_controllers = "ldap1.domain.local;ldap2.domain.local"; |
|
22 | - $method_settings->params->base_dn = "CN=Users,CN=Company,DC=domain,DC=local"; |
|
23 | - $method_settings->params->account_suffix = ""; |
|
24 | - $method_settings->params->ad_port = 389; |
|
19 | + $method_settings = new StdClass (); |
|
20 | + # set default values |
|
21 | + @$method_settings->params->domain_controllers = "ldap1.domain.local;ldap2.domain.local"; |
|
22 | + $method_settings->params->base_dn = "CN=Users,CN=Company,DC=domain,DC=local"; |
|
23 | + $method_settings->params->account_suffix = ""; |
|
24 | + $method_settings->params->ad_port = 389; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | # set delete flag |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | <div class="pContent"> |
46 | 46 | |
47 | 47 | <?php |
48 | - # make sure LDAP is supported ! |
|
49 | - if (!in_array("ldap", get_loaded_extensions())) { $Result->show("danger", _("ldap extension not enabled in php")."!<hr>", false); } |
|
50 | - ?> |
|
48 | + # make sure LDAP is supported ! |
|
49 | + if (!in_array("ldap", get_loaded_extensions())) { $Result->show("danger", _("ldap extension not enabled in php")."!<hr>", false); } |
|
50 | + ?> |
|
51 | 51 | |
52 | 52 | <form id="editAuthMethod" name="editAuthMethod"> |
53 | 53 | <table class="editAuthMethod table table-noborder table-condensed"> |
@@ -178,14 +178,14 @@ discard block |
||
178 | 178 | </div> |
179 | 179 | |
180 | 180 | <?php |
181 | - if($_POST['action']=="delete") { |
|
182 | - # check for mathing users |
|
183 | - $users = $Admin->fetch_multiple_objects ("users", "authMethod", @$method_settings->id); |
|
184 | - if($users!==false) { |
|
185 | - $Result->show("warning", sizeof($users)._(" users have this method for logging in. They will be reset to local auth!"), false); |
|
186 | - } |
|
187 | - } |
|
188 | - ?> |
|
181 | + if($_POST['action']=="delete") { |
|
182 | + # check for mathing users |
|
183 | + $users = $Admin->fetch_multiple_objects ("users", "authMethod", @$method_settings->id); |
|
184 | + if($users!==false) { |
|
185 | + $Result->show("warning", sizeof($users)._(" users have this method for logging in. They will be reset to local auth!"), false); |
|
186 | + } |
|
187 | + } |
|
188 | + ?> |
|
189 | 189 | |
190 | 190 | <!-- Result --> |
191 | 191 | <div class="editAuthMethodResult"></div> |
@@ -18,8 +18,8 @@ |
||
18 | 18 | |
19 | 19 | # if edit check if protected? |
20 | 20 | if($_POST['action']!="add") { |
21 | - $auth_method = $Admin->fetch_object("usersAuthMethod", "id", $_POST['id']); |
|
22 | - if($auth_method->protected=="Yes") { $Result->show("danger", _("Method cannot be change as it is protected"), true, true); } |
|
21 | + $auth_method = $Admin->fetch_object("usersAuthMethod", "id", $_POST['id']); |
|
22 | + if($auth_method->protected=="Yes") { $Result->show("danger", _("Method cannot be change as it is protected"), true, true); } |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | # route to proper auth method editing |
@@ -48,45 +48,45 @@ |
||
48 | 48 | |
49 | 49 | # set update values |
50 | 50 | $values = array("id"=>1, |
51 | - //site settings |
|
52 | - "siteTitle"=>@$_POST['siteTitle'], |
|
53 | - "siteDomain"=>@$_POST['siteDomain'], |
|
54 | - "siteURL"=>@$_POST['siteURL'], |
|
55 | - "siteLoginText"=>@$_POST['siteLoginText'], |
|
56 | - "prettyLinks"=>@$_POST['prettyLinks'], |
|
57 | - "defaultLang"=>@$_POST['defaultLang'], |
|
58 | - "inactivityTimeout"=>@$_POST['inactivityTimeout'], |
|
59 | - //admin |
|
60 | - "siteAdminName"=>@$_POST['siteAdminName'], |
|
61 | - "siteAdminMail"=>@$_POST['siteAdminMail'], |
|
62 | - //features |
|
63 | - "api"=>$Admin->verify_checkbox(@$_POST['api']), |
|
64 | - "enableIPrequests"=>$Admin->verify_checkbox(@$_POST['enableIPrequests']), |
|
65 | - "enableMulticast"=>$Admin->verify_checkbox(@$_POST['enableMulticast']), |
|
66 | - "enableRACK"=>$Admin->verify_checkbox(@$_POST['enableRACK']), |
|
67 | - "enableSNMP"=>$Admin->verify_checkbox(@$_POST['enableSNMP']), |
|
68 | - "enableThreshold"=>$Admin->verify_checkbox(@$_POST['enableThreshold']), |
|
69 | - "enableVRF"=>$Admin->verify_checkbox(@$_POST['enableVRF']), |
|
70 | - "enableDNSresolving"=>$Admin->verify_checkbox(@$_POST['enableDNSresolving']), |
|
71 | - "vlanDuplicate"=>$Admin->verify_checkbox(@$_POST['vlanDuplicate']), |
|
72 | - "vlanMax"=>@$_POST['vlanMax'], |
|
73 | - "enableChangelog"=>$Admin->verify_checkbox(@$_POST['enableChangelog']), |
|
74 | - "tempShare"=>$Admin->verify_checkbox(@$_POST['tempShare']), |
|
75 | - "enablePowerDNS"=>$Admin->verify_checkbox(@$_POST['enablePowerDNS']), |
|
76 | - "enableFirewallZones"=>$Admin->verify_checkbox(@$_POST['enableFirewallZones']), |
|
77 | - "log"=>@$_POST['log'], |
|
78 | - //display |
|
79 | - "donate"=>$Admin->verify_checkbox(@$_POST['donate']), |
|
80 | - "visualLimit"=>@$_POST['visualLimit'], |
|
81 | - "subnetOrdering"=>@$_POST['subnetOrdering'], |
|
82 | - "subnetView"=>@$_POST['subnetView'], |
|
83 | - //ping |
|
84 | - "scanPingType"=>@$_POST['scanPingType'], |
|
85 | - "pingStatus"=>@$_POST['pingStatus'], |
|
86 | - "scanPingPath"=>@$_POST['scanPingPath'], |
|
87 | - "scanFPingPath"=>@$_POST['scanFPingPath'], |
|
88 | - "scanMaxThreads"=>@$_POST['scanMaxThreads'] |
|
89 | - ); |
|
51 | + //site settings |
|
52 | + "siteTitle"=>@$_POST['siteTitle'], |
|
53 | + "siteDomain"=>@$_POST['siteDomain'], |
|
54 | + "siteURL"=>@$_POST['siteURL'], |
|
55 | + "siteLoginText"=>@$_POST['siteLoginText'], |
|
56 | + "prettyLinks"=>@$_POST['prettyLinks'], |
|
57 | + "defaultLang"=>@$_POST['defaultLang'], |
|
58 | + "inactivityTimeout"=>@$_POST['inactivityTimeout'], |
|
59 | + //admin |
|
60 | + "siteAdminName"=>@$_POST['siteAdminName'], |
|
61 | + "siteAdminMail"=>@$_POST['siteAdminMail'], |
|
62 | + //features |
|
63 | + "api"=>$Admin->verify_checkbox(@$_POST['api']), |
|
64 | + "enableIPrequests"=>$Admin->verify_checkbox(@$_POST['enableIPrequests']), |
|
65 | + "enableMulticast"=>$Admin->verify_checkbox(@$_POST['enableMulticast']), |
|
66 | + "enableRACK"=>$Admin->verify_checkbox(@$_POST['enableRACK']), |
|
67 | + "enableSNMP"=>$Admin->verify_checkbox(@$_POST['enableSNMP']), |
|
68 | + "enableThreshold"=>$Admin->verify_checkbox(@$_POST['enableThreshold']), |
|
69 | + "enableVRF"=>$Admin->verify_checkbox(@$_POST['enableVRF']), |
|
70 | + "enableDNSresolving"=>$Admin->verify_checkbox(@$_POST['enableDNSresolving']), |
|
71 | + "vlanDuplicate"=>$Admin->verify_checkbox(@$_POST['vlanDuplicate']), |
|
72 | + "vlanMax"=>@$_POST['vlanMax'], |
|
73 | + "enableChangelog"=>$Admin->verify_checkbox(@$_POST['enableChangelog']), |
|
74 | + "tempShare"=>$Admin->verify_checkbox(@$_POST['tempShare']), |
|
75 | + "enablePowerDNS"=>$Admin->verify_checkbox(@$_POST['enablePowerDNS']), |
|
76 | + "enableFirewallZones"=>$Admin->verify_checkbox(@$_POST['enableFirewallZones']), |
|
77 | + "log"=>@$_POST['log'], |
|
78 | + //display |
|
79 | + "donate"=>$Admin->verify_checkbox(@$_POST['donate']), |
|
80 | + "visualLimit"=>@$_POST['visualLimit'], |
|
81 | + "subnetOrdering"=>@$_POST['subnetOrdering'], |
|
82 | + "subnetView"=>@$_POST['subnetView'], |
|
83 | + //ping |
|
84 | + "scanPingType"=>@$_POST['scanPingType'], |
|
85 | + "pingStatus"=>@$_POST['pingStatus'], |
|
86 | + "scanPingPath"=>@$_POST['scanPingPath'], |
|
87 | + "scanFPingPath"=>@$_POST['scanFPingPath'], |
|
88 | + "scanMaxThreads"=>@$_POST['scanMaxThreads'] |
|
89 | + ); |
|
90 | 90 | if(!$Admin->object_modify("settings", "edit", "id", $values)) { $Result->show("danger", _("Cannot update settings"), true); } |
91 | 91 | else { $Result->show("success", _("Settings updated successfully"), true); } |
92 | 92 | ?> |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | <td> |
83 | 83 | <select name="prettyLinks" class="form-control input-sm input-w-auto"> |
84 | 84 | <?php |
85 | - print "<option value='No'>"._('No')."</option>"; |
|
86 | - if($settings['prettyLinks']=="Yes") { print "<option value='Yes' selected='selected'>"._('Yes')."</option>"; } |
|
87 | - else { print "<option value='Yes'>"._('Yes')."</option>"; } |
|
88 | - ?> |
|
85 | + print "<option value='No'>"._('No')."</option>"; |
|
86 | + if($settings['prettyLinks']=="Yes") { print "<option value='Yes' selected='selected'>"._('Yes')."</option>"; } |
|
87 | + else { print "<option value='Yes'>"._('Yes')."</option>"; } |
|
88 | + ?> |
|
89 | 89 | </select> |
90 | 90 | </td> |
91 | 91 | <td class="info2"> |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | <td> |
105 | 105 | <select name="defaultLang" class="form-control input-sm input-w-auto"> |
106 | 106 | <?php |
107 | - if(sizeof($languages)>0) { |
|
108 | - //default |
|
109 | - print "<option value='0'>Default</option>"; |
|
110 | - foreach($languages as $lang) { |
|
111 | - if($lang->l_id==$settings['defaultLang']) { print "<option value='$lang->l_id' selected='selected'>$lang->l_name ($lang->l_code)</option>"; } |
|
112 | - else { print "<option value='$lang->l_id' >$lang->l_name ($lang->l_code)</option>"; } |
|
113 | - } |
|
114 | - } |
|
115 | - ?> |
|
107 | + if(sizeof($languages)>0) { |
|
108 | + //default |
|
109 | + print "<option value='0'>Default</option>"; |
|
110 | + foreach($languages as $lang) { |
|
111 | + if($lang->l_id==$settings['defaultLang']) { print "<option value='$lang->l_id' selected='selected'>$lang->l_name ($lang->l_code)</option>"; } |
|
112 | + else { print "<option value='$lang->l_id' >$lang->l_name ($lang->l_code)</option>"; } |
|
113 | + } |
|
114 | + } |
|
115 | + ?> |
|
116 | 116 | </select> |
117 | 117 | </td> |
118 | 118 | <td class="info2"><?php print _('Select default language'); ?></td> |
@@ -124,13 +124,13 @@ discard block |
||
124 | 124 | <td> |
125 | 125 | <select name="inactivityTimeout" class="form-control input-sm input-w-auto"> |
126 | 126 | <?php |
127 | - $durations = array("900"=>"15 minutes","1800"=>"30 minutes", "3600"=>"1 hour", "7200"=>"2 hours", "21600"=>"6 hours", "43200"=>"12 hours", "86400"=>"24 hours"); |
|
128 | - //default |
|
129 | - foreach($durations as $k=>$d) { |
|
130 | - if($k==$settings['inactivityTimeout']) { print "<option value='$k' selected='selected'>$d</option>"; } |
|
131 | - else { print "<option value='$k' >$d</option>"; } |
|
132 | - } |
|
133 | - ?> |
|
127 | + $durations = array("900"=>"15 minutes","1800"=>"30 minutes", "3600"=>"1 hour", "7200"=>"2 hours", "21600"=>"6 hours", "43200"=>"12 hours", "86400"=>"24 hours"); |
|
128 | + //default |
|
129 | + foreach($durations as $k=>$d) { |
|
130 | + if($k==$settings['inactivityTimeout']) { print "<option value='$k' selected='selected'>$d</option>"; } |
|
131 | + else { print "<option value='$k' >$d</option>"; } |
|
132 | + } |
|
133 | + ?> |
|
134 | 134 | </select> |
135 | 135 | </td> |
136 | 136 | <td class="info2"><?php print _('Select inactive timeout for user sessions. Please note that if default php session settings in php.ini are lower they will override this'); ?></td> |
@@ -320,13 +320,13 @@ discard block |
||
320 | 320 | <td> |
321 | 321 | <select name="log" class="form-control input-sm input-w-auto"> |
322 | 322 | <?php |
323 | - $types = array("Database"=>"Database", "syslog"=>"Syslog", "both"=>"Syslog and local Database"); |
|
324 | - //default |
|
325 | - foreach($types as $k=>$d) { |
|
326 | - if($k==$settings['log']) { print "<option value='$k' selected='selected'>$d</option>"; } |
|
327 | - else { print "<option value='$k' >$d</option>"; } |
|
328 | - } |
|
329 | - ?> |
|
323 | + $types = array("Database"=>"Database", "syslog"=>"Syslog", "both"=>"Syslog and local Database"); |
|
324 | + //default |
|
325 | + foreach($types as $k=>$d) { |
|
326 | + if($k==$settings['log']) { print "<option value='$k' selected='selected'>$d</option>"; } |
|
327 | + else { print "<option value='$k' >$d</option>"; } |
|
328 | + } |
|
329 | + ?> |
|
330 | 330 | </select> |
331 | 331 | |
332 | 332 | </td> |
@@ -348,13 +348,13 @@ discard block |
||
348 | 348 | <td> |
349 | 349 | <select name="scanPingType" class="form-control input-sm input-w-auto"> |
350 | 350 | <?php |
351 | - $types = array("ping"=>"ping", "pear"=>"pear ping", "fping"=>"fping"); |
|
352 | - //default |
|
353 | - foreach($types as $k=>$d) { |
|
354 | - if($k==$settings['scanPingType']) { print "<option value='$k' selected='selected'>$d</option>"; } |
|
355 | - else { print "<option value='$k' >$d</option>"; } |
|
356 | - } |
|
357 | - ?> |
|
351 | + $types = array("ping"=>"ping", "pear"=>"pear ping", "fping"=>"fping"); |
|
352 | + //default |
|
353 | + foreach($types as $k=>$d) { |
|
354 | + if($k==$settings['scanPingType']) { print "<option value='$k' selected='selected'>$d</option>"; } |
|
355 | + else { print "<option value='$k' >$d</option>"; } |
|
356 | + } |
|
357 | + ?> |
|
358 | 358 | </select> |
359 | 359 | </td> |
360 | 360 | <td class="info2"><?php print _('Select which utility to use for status checks.'); ?></td> |
@@ -365,10 +365,10 @@ discard block |
||
365 | 365 | <tr> |
366 | 366 | <td class="title"><?php print _('Ping path'); ?></td> |
367 | 367 | <?php |
368 | - //verify that ping file exists! |
|
369 | - if(!file_exists($settings['scanPingPath'])&&$settings['scanFPingType']=="ping") { $class="danger"; } |
|
370 | - else { $class=""; } |
|
371 | - ?> |
|
368 | + //verify that ping file exists! |
|
369 | + if(!file_exists($settings['scanPingPath'])&&$settings['scanFPingType']=="ping") { $class="danger"; } |
|
370 | + else { $class=""; } |
|
371 | + ?> |
|
372 | 372 | <td class="<?php print $class; ?>"> |
373 | 373 | <input type="text" class="form-control input-sm" name="scanPingPath" value="<?php print $settings['scanPingPath']; ?>"> |
374 | 374 | </td> |
@@ -381,10 +381,10 @@ discard block |
||
381 | 381 | <tr> |
382 | 382 | <td class="title"><?php print _('FPing path'); ?></td> |
383 | 383 | <?php |
384 | - //verify that ping file exists! |
|
385 | - if(!file_exists($settings['scanFPingPath'])&&$settings['scanFPingType']=="fping") { $class="danger"; } |
|
386 | - else { $class=""; } |
|
387 | - ?> |
|
384 | + //verify that ping file exists! |
|
385 | + if(!file_exists($settings['scanFPingPath'])&&$settings['scanFPingType']=="fping") { $class="danger"; } |
|
386 | + else { $class=""; } |
|
387 | + ?> |
|
388 | 388 | <td class="<?php print $class; ?>"> |
389 | 389 | <input type="text" class="form-control input-sm" name="scanFPingPath" value="<?php print $settings['scanFPingPath']; ?>"> |
390 | 390 | </td> |
@@ -441,22 +441,22 @@ discard block |
||
441 | 441 | <td> |
442 | 442 | <select name="visualLimit" class="form-control input-sm input-w-auto"> |
443 | 443 | <?php |
444 | - $opts = array( |
|
445 | - "0"=>_("Don't show visual display"), |
|
446 | - "19"=>"/19 (8190)", |
|
447 | - "20"=>"/20 (4094)", |
|
448 | - "21"=>"/21 (2046)", |
|
449 | - "22"=>"/22 (1024)", |
|
450 | - "23"=>"/23 (512)", |
|
451 | - "24"=>"/24 (256)" |
|
452 | - ); |
|
453 | - |
|
454 | - foreach($opts as $key=>$line) { |
|
455 | - if($settings['visualLimit'] == $key) { print "<option value='$key' selected>$line</option>"; } |
|
456 | - else { print "<option value='$key'>$line</option>"; } |
|
457 | - } |
|
458 | - |
|
459 | - ?> |
|
444 | + $opts = array( |
|
445 | + "0"=>_("Don't show visual display"), |
|
446 | + "19"=>"/19 (8190)", |
|
447 | + "20"=>"/20 (4094)", |
|
448 | + "21"=>"/21 (2046)", |
|
449 | + "22"=>"/22 (1024)", |
|
450 | + "23"=>"/23 (512)", |
|
451 | + "24"=>"/24 (256)" |
|
452 | + ); |
|
453 | + |
|
454 | + foreach($opts as $key=>$line) { |
|
455 | + if($settings['visualLimit'] == $key) { print "<option value='$key' selected>$line</option>"; } |
|
456 | + else { print "<option value='$key'>$line</option>"; } |
|
457 | + } |
|
458 | + |
|
459 | + ?> |
|
460 | 460 | </select> |
461 | 461 | </td> |
462 | 462 | <td class="info2"> |
@@ -470,19 +470,19 @@ discard block |
||
470 | 470 | <td> |
471 | 471 | <select name="subnetOrdering" class="form-control input-sm input-w-auto"> |
472 | 472 | <?php |
473 | - $opts = array( |
|
474 | - "subnet,asc" => _("Subnet, ascending"), |
|
475 | - "subnet,desc" => _("Subnet, descending"), |
|
476 | - "description,asc" => _("Description, ascending"), |
|
477 | - "description,desc" => _("Description, descending"), |
|
478 | - ); |
|
479 | - |
|
480 | - foreach($opts as $key=>$line) { |
|
481 | - if($settings['subnetOrdering'] == $key) { print "<option value='$key' selected>$line</option>"; } |
|
482 | - else { print "<option value='$key'>$line</option>"; } |
|
483 | - } |
|
484 | - |
|
485 | - ?> |
|
473 | + $opts = array( |
|
474 | + "subnet,asc" => _("Subnet, ascending"), |
|
475 | + "subnet,desc" => _("Subnet, descending"), |
|
476 | + "description,asc" => _("Description, ascending"), |
|
477 | + "description,desc" => _("Description, descending"), |
|
478 | + ); |
|
479 | + |
|
480 | + foreach($opts as $key=>$line) { |
|
481 | + if($settings['subnetOrdering'] == $key) { print "<option value='$key' selected>$line</option>"; } |
|
482 | + else { print "<option value='$key'>$line</option>"; } |
|
483 | + } |
|
484 | + |
|
485 | + ?> |
|
486 | 486 | </select> |
487 | 487 | </td> |
488 | 488 | <td class="info2"> |
@@ -496,16 +496,16 @@ discard block |
||
496 | 496 | <td> |
497 | 497 | <select name="subnetView" class="form-control input-sm input-w-auto"> |
498 | 498 | <?php |
499 | - $opts = array( |
|
500 | - "0"=>_("Subnet Network Only"), |
|
501 | - "1"=>"Description Only", |
|
502 | - "2"=>"Subnet Network and Description" |
|
503 | - ); |
|
504 | - foreach($opts as $key=>$line) { |
|
505 | - if($settings['subnetView'] == $key) { print "<option value='$key' selected>$line</option>"; } |
|
506 | - else { print "<option value='$key'>$line</option>"; } |
|
507 | - } |
|
508 | - ?> |
|
499 | + $opts = array( |
|
500 | + "0"=>_("Subnet Network Only"), |
|
501 | + "1"=>"Description Only", |
|
502 | + "2"=>"Subnet Network and Description" |
|
503 | + ); |
|
504 | + foreach($opts as $key=>$line) { |
|
505 | + if($settings['subnetView'] == $key) { print "<option value='$key' selected>$line</option>"; } |
|
506 | + else { print "<option value='$key'>$line</option>"; } |
|
507 | + } |
|
508 | + ?> |
|
509 | 509 | </select> |
510 | 510 | </td> |
511 | 511 | <td class="info2"> |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | # fetch all available LDAP servers |
20 | 20 | $servers = $Admin->fetch_all_objects ("usersAuthMethod"); |
21 | 21 | foreach($servers as $k=>$s) { |
22 | - if($s->type!="AD" && $s->type!="LDAP" && $s->type!="NetIQ") { |
|
23 | - unset($servers[$k]); |
|
24 | - } |
|
22 | + if($s->type!="AD" && $s->type!="LDAP" && $s->type!="NetIQ") { |
|
23 | + unset($servers[$k]); |
|
24 | + } |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | # die if no servers |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | <td> |
43 | 43 | <select name="server" id="adserver" class="form-control input-w-auto"> |
44 | 44 | <?php |
45 | - foreach($servers as $s) { |
|
46 | - print "<option value='$s->id'>$s->description</option>"; |
|
47 | - } |
|
48 | - ?> |
|
45 | + foreach($servers as $s) { |
|
46 | + print "<option value='$s->id'>$s->description</option>"; |
|
47 | + } |
|
48 | + ?> |
|
49 | 49 | </select> |
50 | 50 | </td> |
51 | 51 | </tr> |
@@ -22,38 +22,38 @@ |
||
22 | 22 | |
23 | 23 | # parse result |
24 | 24 | foreach($_POST as $k=>$p) { |
25 | - if(substr($k, 0,4) == "user") { |
|
26 | - $users[substr($k, 4)] = substr($k, 4); |
|
27 | - } |
|
25 | + if(substr($k, 0,4) == "user") { |
|
26 | + $users[substr($k, 4)] = substr($k, 4); |
|
27 | + } |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | # remove each user from group |
31 | 31 | if(sizeof($users)>0) { |
32 | - foreach($users as $key=>$u) { |
|
33 | - if(!$Admin->remove_group_from_user($_POST['gid'], $u)) { |
|
34 | - # get user details |
|
35 | - $user = $Admin->fetch_object("users", "id", $u); |
|
36 | - $errors[] = $user->real_name; |
|
37 | - } |
|
38 | - } |
|
32 | + foreach($users as $key=>$u) { |
|
33 | + if(!$Admin->remove_group_from_user($_POST['gid'], $u)) { |
|
34 | + # get user details |
|
35 | + $user = $Admin->fetch_object("users", "id", $u); |
|
36 | + $errors[] = $user->real_name; |
|
37 | + } |
|
38 | + } |
|
39 | 39 | } |
40 | 40 | else { |
41 | - $errors[] = _("Please select user(s) to remove from group!"); |
|
41 | + $errors[] = _("Please select user(s) to remove from group!"); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | # print result |
45 | 45 | if(isset($errors)) { |
46 | - print "<div class='alert alert alert-danger'>"; |
|
47 | - print _("Failed to remove users").":<hr>"; |
|
48 | - print "<ul>"; |
|
49 | - foreach($errors as $e) { |
|
50 | - print "<li>$e</li>"; |
|
51 | - } |
|
52 | - print "</ul>"; |
|
53 | - print "</div>"; |
|
46 | + print "<div class='alert alert alert-danger'>"; |
|
47 | + print _("Failed to remove users").":<hr>"; |
|
48 | + print "<ul>"; |
|
49 | + foreach($errors as $e) { |
|
50 | + print "<li>$e</li>"; |
|
51 | + } |
|
52 | + print "</ul>"; |
|
53 | + print "</div>"; |
|
54 | 54 | } |
55 | 55 | else { |
56 | - $Result->show("success", _('Users removed from group'), true); |
|
56 | + $Result->show("success", _('Users removed from group'), true); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | ?> |
60 | 60 | \ No newline at end of file |
@@ -49,24 +49,24 @@ |
||
49 | 49 | </tr> |
50 | 50 | |
51 | 51 | <?php |
52 | - # show existing |
|
53 | - foreach($existing as $m) { |
|
54 | - # get user details |
|
55 | - $u = (array) $Admin->fetch_object("users", "id", $m); |
|
52 | + # show existing |
|
53 | + foreach($existing as $m) { |
|
54 | + # get user details |
|
55 | + $u = (array) $Admin->fetch_object("users", "id", $m); |
|
56 | 56 | |
57 | - print "<tr>"; |
|
57 | + print "<tr>"; |
|
58 | 58 | |
59 | - print " <td>"; |
|
60 | - print " <input type='checkbox' name='user$u[id]'>"; |
|
61 | - print " </td>"; |
|
59 | + print " <td>"; |
|
60 | + print " <input type='checkbox' name='user$u[id]'>"; |
|
61 | + print " </td>"; |
|
62 | 62 | |
63 | - print " <td>$u[real_name]</td>"; |
|
64 | - print " <td>$u[username]</td>"; |
|
65 | - print " <td>$u[email]</td>"; |
|
63 | + print " <td>$u[real_name]</td>"; |
|
64 | + print " <td>$u[username]</td>"; |
|
65 | + print " <td>$u[email]</td>"; |
|
66 | 66 | |
67 | - print "</tr>"; |
|
68 | - } |
|
69 | - ?> |
|
67 | + print "</tr>"; |
|
68 | + } |
|
69 | + ?> |
|
70 | 70 | |
71 | 71 | </table> |
72 | 72 | </form> |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | |
27 | 27 | # remove users from this group if delete and remove group from sections |
28 | 28 | if($_POST['action'] == "delete") { |
29 | - $Admin->remove_group_from_users($_POST['g_id']); |
|
30 | - $Admin->remove_group_from_sections($_POST['g_id']); |
|
29 | + $Admin->remove_group_from_users($_POST['g_id']); |
|
30 | + $Admin->remove_group_from_sections($_POST['g_id']); |
|
31 | 31 | } |
32 | 32 | else { |
33 | - if(strlen($_POST['g_name']) < 2) { $Result->show("danger", _('Name must be at least 2 characters long')."!", true); } |
|
33 | + if(strlen($_POST['g_name']) < 2) { $Result->show("danger", _('Name must be at least 2 characters long')."!", true); } |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | # unique name |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | |
41 | 41 | # create array of values for modification |
42 | 42 | $values = array("g_id"=>@$_POST['g_id'], |
43 | - "g_name"=>$_POST['g_name'], |
|
44 | - "g_desc"=>@$_POST['g_desc']); |
|
43 | + "g_name"=>$_POST['g_name'], |
|
44 | + "g_desc"=>@$_POST['g_desc']); |
|
45 | 45 | |
46 | 46 | /* try to execute */ |
47 | 47 | if(!$Admin->object_modify("userGroups", $_POST['action'], "g_id", $values)) { $Result->show("danger", _("Group $_POST[action] error")."!", false); } |
@@ -49,19 +49,19 @@ discard block |
||
49 | 49 | |
50 | 50 | # from list of usernames provided from AD result if some user matches add him to group |
51 | 51 | if (strlen($_POST['gmembers'])>0) { |
52 | - // save id |
|
53 | - $gid = $Admin->lastId; |
|
54 | - // to array |
|
55 | - $gmembers = explode(";", $_POST['gmembers']); |
|
56 | - // check |
|
57 | - foreach ($gmembers as $gm) { |
|
58 | - // check if user exists |
|
59 | - $user=$Admin->fetch_object("users","username",$gm); |
|
60 | - if ($user!==false) { |
|
61 | - // add to group |
|
62 | - $Admin->add_group_to_user ($gid, $user->id); |
|
63 | - } |
|
64 | - } |
|
52 | + // save id |
|
53 | + $gid = $Admin->lastId; |
|
54 | + // to array |
|
55 | + $gmembers = explode(";", $_POST['gmembers']); |
|
56 | + // check |
|
57 | + foreach ($gmembers as $gm) { |
|
58 | + // check if user exists |
|
59 | + $user=$Admin->fetch_object("users","username",$gm); |
|
60 | + if ($user!==false) { |
|
61 | + // add to group |
|
62 | + $Admin->add_group_to_user ($gid, $user->id); |
|
63 | + } |
|
64 | + } |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | ?> |
68 | 68 | \ No newline at end of file |