@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | <div class="btn-group" style="margin-bottom: 20px;"> |
18 | 18 | <?php |
19 | 19 | foreach($all_method_types as $type) { |
20 | - print "<button class='btn btn-sm btn-default editAuthMethod' style='margin-bottom:10px;' data-action='add' data-type='$type'><i class='fa fa-plus'></i> "._("Create new $type authentication")."</button>"; |
|
20 | + print "<button class='btn btn-sm btn-default editAuthMethod' style='margin-bottom:10px;' data-action='add' data-type='$type'><i class='fa fa-plus'></i> "._("Create new $type authentication")."</button>"; |
|
21 | 21 | } |
22 | 22 | ?> |
23 | 23 | </div> |
@@ -39,44 +39,44 @@ discard block |
||
39 | 39 | <?php |
40 | 40 | //loop |
41 | 41 | foreach($all_methods as $method) { |
42 | - //set protected |
|
43 | - $protected_class = $method->protected=="yes" ? "danger" : ""; |
|
42 | + //set protected |
|
43 | + $protected_class = $method->protected=="yes" ? "danger" : ""; |
|
44 | 44 | |
45 | - //number of users |
|
46 | - $user_num = $Database->numObjectsFilter("users", "authMethod", $method->id); |
|
45 | + //number of users |
|
46 | + $user_num = $Database->numObjectsFilter("users", "authMethod", $method->id); |
|
47 | 47 | |
48 | - print "<tr>"; |
|
49 | - print " <td>$method->type</td>"; |
|
50 | - print " <td>$method->description</td>"; |
|
51 | - //parameters |
|
52 | - print " <td>"; |
|
53 | - print " <span class='text-muted'>"; |
|
54 | - if(strlen($method->params)>0) { |
|
55 | - $params = json_decode($method->params); |
|
56 | - foreach($params as $key=>$parameter) { |
|
57 | - // mask user/pass |
|
58 | - if($key=="adminPassword") { $parameter = "********"; } |
|
59 | ||
60 | - print $key." => ".$parameter."<br>"; |
|
61 | - } |
|
62 | - } |
|
63 | - else { |
|
64 | - print "no parameters"; |
|
65 | - } |
|
66 | - print " </span>"; |
|
67 | - print " </td>"; |
|
68 | - print " <td class='$protected_class'>$user_num</td>"; |
|
69 | - print " <td class='$protected_class'>$method->protected</td>"; |
|
70 | - //actions |
|
71 | - $disabled = $method->type=="local" ? "disabled" : ""; |
|
72 | - print " <td class='actions'>"; |
|
73 | - print " <div class='btn-group'>"; |
|
74 | - print " <button class='btn btn-xs btn-default editAuthMethod' data-id='$method->id' data-action='edit' data-type='$method->type' rel='tooltip' title='Edit'><i class='fa fa-pencil'></i></button>"; |
|
75 | - print " <button class='btn btn-xs btn-default editAuthMethod' data-id='$method->id' data-action='delete' data-type='$method->type' rel='tooltip' title='Delete'><i class='fa fa-times'></i></button>"; |
|
76 | - print " <button class='btn btn-xs btn-default checkAuthMethod' data-id='$method->id' data-action='check' data-type='$method->type' rel='tooltip' title='Verify connection' $disabled><i class='fa fa-bolt'></i></button>"; |
|
77 | - print " </div>"; |
|
78 | - print " </td>"; |
|
79 | - print "</tr>"; |
|
48 | + print "<tr>"; |
|
49 | + print " <td>$method->type</td>"; |
|
50 | + print " <td>$method->description</td>"; |
|
51 | + //parameters |
|
52 | + print " <td>"; |
|
53 | + print " <span class='text-muted'>"; |
|
54 | + if(strlen($method->params)>0) { |
|
55 | + $params = json_decode($method->params); |
|
56 | + foreach($params as $key=>$parameter) { |
|
57 | + // mask user/pass |
|
58 | + if($key=="adminPassword") { $parameter = "********"; } |
|
59 | ||
60 | + print $key." => ".$parameter."<br>"; |
|
61 | + } |
|
62 | + } |
|
63 | + else { |
|
64 | + print "no parameters"; |
|
65 | + } |
|
66 | + print " </span>"; |
|
67 | + print " </td>"; |
|
68 | + print " <td class='$protected_class'>$user_num</td>"; |
|
69 | + print " <td class='$protected_class'>$method->protected</td>"; |
|
70 | + //actions |
|
71 | + $disabled = $method->type=="local" ? "disabled" : ""; |
|
72 | + print " <td class='actions'>"; |
|
73 | + print " <div class='btn-group'>"; |
|
74 | + print " <button class='btn btn-xs btn-default editAuthMethod' data-id='$method->id' data-action='edit' data-type='$method->type' rel='tooltip' title='Edit'><i class='fa fa-pencil'></i></button>"; |
|
75 | + print " <button class='btn btn-xs btn-default editAuthMethod' data-id='$method->id' data-action='delete' data-type='$method->type' rel='tooltip' title='Delete'><i class='fa fa-times'></i></button>"; |
|
76 | + print " <button class='btn btn-xs btn-default checkAuthMethod' data-id='$method->id' data-action='check' data-type='$method->type' rel='tooltip' title='Verify connection' $disabled><i class='fa fa-bolt'></i></button>"; |
|
77 | + print " </div>"; |
|
78 | + print " </td>"; |
|
79 | + print "</tr>"; |
|
80 | 80 | } |
81 | 81 | ?> |
82 | 82 | </table> |
@@ -1,23 +1,23 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | # verify that user is logged in |
4 | -$User->check_user_session(); |
|
4 | +$User->check_user_session (); |
|
5 | 5 | |
6 | 6 | # fetch all auth methods |
7 | -$all_methods = $Admin->fetch_all_objects("usersAuthMethod"); |
|
7 | +$all_methods = $Admin->fetch_all_objects ("usersAuthMethod"); |
|
8 | 8 | # fetch all parameters for each method |
9 | -$all_method_types = $User->fetch_available_auth_method_types(); |
|
9 | +$all_method_types = $User->fetch_available_auth_method_types (); |
|
10 | 10 | ?> |
11 | 11 | |
12 | 12 | |
13 | -<h4><?php print _("Authentication methods"); ?></h4> |
|
13 | +<h4><?php print _ ("Authentication methods"); ?></h4> |
|
14 | 14 | <hr> |
15 | 15 | |
16 | 16 | <!-- Add new --> |
17 | 17 | <div class="btn-group" style="margin-bottom: 20px;"> |
18 | 18 | <?php |
19 | -foreach($all_method_types as $type) { |
|
20 | - print "<button class='btn btn-sm btn-default editAuthMethod' style='margin-bottom:10px;' data-action='add' data-type='$type'><i class='fa fa-plus'></i> "._("Create new $type authentication")."</button>"; |
|
19 | +foreach ($all_method_types as $type) { |
|
20 | + print "<button class='btn btn-sm btn-default editAuthMethod' style='margin-bottom:10px;' data-action='add' data-type='$type'><i class='fa fa-plus'></i> "._ ("Create new $type authentication")."</button>"; |
|
21 | 21 | } |
22 | 22 | ?> |
23 | 23 | </div> |
@@ -27,23 +27,23 @@ discard block |
||
27 | 27 | |
28 | 28 | <!-- Headers --> |
29 | 29 | <tr> |
30 | - <th><?php print _('Type'); ?></th> |
|
31 | - <th><?php print _('Description'); ?></th> |
|
32 | - <th><?php print _('Parameters'); ?></th> |
|
33 | - <th><?php print _('Users'); ?></th> |
|
34 | - <th><?php print _('Protected'); ?></th> |
|
30 | + <th><?php print _ ('Type'); ?></th> |
|
31 | + <th><?php print _ ('Description'); ?></th> |
|
32 | + <th><?php print _ ('Parameters'); ?></th> |
|
33 | + <th><?php print _ ('Users'); ?></th> |
|
34 | + <th><?php print _ ('Protected'); ?></th> |
|
35 | 35 | <th></th> |
36 | 36 | </tr> |
37 | 37 | |
38 | 38 | <!-- data --> |
39 | 39 | <?php |
40 | 40 | //loop |
41 | -foreach($all_methods as $method) { |
|
41 | +foreach ($all_methods as $method) { |
|
42 | 42 | //set protected |
43 | - $protected_class = $method->protected=="yes" ? "danger" : ""; |
|
43 | + $protected_class = $method->protected == "yes" ? "danger" : ""; |
|
44 | 44 | |
45 | 45 | //number of users |
46 | - $user_num = $Database->numObjectsFilter("users", "authMethod", $method->id); |
|
46 | + $user_num = $Database->numObjectsFilter ("users", "authMethod", $method->id); |
|
47 | 47 | |
48 | 48 | print "<tr>"; |
49 | 49 | print " <td>$method->type</td>"; |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | //parameters |
52 | 52 | print " <td>"; |
53 | 53 | print " <span class='text-muted'>"; |
54 | - if(strlen($method->params)>0) { |
|
55 | - $params = json_decode($method->params); |
|
56 | - foreach($params as $key=>$parameter) { |
|
54 | + if (strlen ($method->params) > 0) { |
|
55 | + $params = json_decode ($method->params); |
|
56 | + foreach ($params as $key=>$parameter) { |
|
57 | 57 | // mask user/pass |
58 | - if($key=="adminPassword") { $parameter = "********"; } |
|
58 | + if ($key == "adminPassword") { $parameter = "********"; } |
|
59 | 59 | |
60 | 60 | print $key." => ".$parameter."<br>"; |
61 | 61 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | print " <td class='$protected_class'>$user_num</td>"; |
69 | 69 | print " <td class='$protected_class'>$method->protected</td>"; |
70 | 70 | //actions |
71 | - $disabled = $method->type=="local" ? "disabled" : ""; |
|
71 | + $disabled = $method->type == "local" ? "disabled" : ""; |
|
72 | 72 | print " <td class='actions'>"; |
73 | 73 | print " <div class='btn-group'>"; |
74 | 74 | print " <button class='btn btn-xs btn-default editAuthMethod' data-id='$method->id' data-action='edit' data-type='$method->type' rel='tooltip' title='Edit'><i class='fa fa-pencil'></i></button>"; |
@@ -84,18 +84,18 @@ discard block |
||
84 | 84 | |
85 | 85 | <hr> |
86 | 86 | <div class="alert alert-info alert-absolute" style="margin-top:30px;"> |
87 | - <?php print _("Here you can set different authentication methods for your users."); ?> |
|
87 | + <?php print _ ("Here you can set different authentication methods for your users."); ?> |
|
88 | 88 | <hr> |
89 | - <?php print _("phpIPAM currently supports 6 methods for authentication:"); ?> |
|
89 | + <?php print _ ("phpIPAM currently supports 6 methods for authentication:"); ?> |
|
90 | 90 | <ul> |
91 | - <li><?php print _("Local authentication"); ?></li> |
|
92 | - <li><?php print _("Apache authentication"); ?></li> |
|
93 | - <li><?php print _("AD (Active Directory) authentication"); ?></li> |
|
94 | - <li><?php print _("LDAP authentication"); ?></li> |
|
95 | - <li><?php print _("NetIQ authentication"); ?></li> |
|
96 | - <li><?php print _("Radius authentication"); ?></li> |
|
91 | + <li><?php print _ ("Local authentication"); ?></li> |
|
92 | + <li><?php print _ ("Apache authentication"); ?></li> |
|
93 | + <li><?php print _ ("AD (Active Directory) authentication"); ?></li> |
|
94 | + <li><?php print _ ("LDAP authentication"); ?></li> |
|
95 | + <li><?php print _ ("NetIQ authentication"); ?></li> |
|
96 | + <li><?php print _ ("Radius authentication"); ?></li> |
|
97 | 97 | </ul> |
98 | 98 | <br> |
99 | - <?php print _("For AD/LDAP/NetIQ connection phpipam is using adLDAP, for documentation please check ")."<a href='http://adldap.sourceforge.net/'>adLDAP</a><br><br>"; ?> |
|
100 | - <?php print _('First create new user under user management with <u>same username as on AD</u> and set authention type to one of available methods.')."<br>"._('Also set proper permissions - group membership for new user'); ?> |
|
99 | + <?php print _ ("For AD/LDAP/NetIQ connection phpipam is using adLDAP, for documentation please check ")."<a href='http://adldap.sourceforge.net/'>adLDAP</a><br><br>"; ?> |
|
100 | + <?php print _ ('First create new user under user management with <u>same username as on AD</u> and set authention type to one of available methods.')."<br>"._ ('Also set proper permissions - group membership for new user'); ?> |
|
101 | 101 | </div> |
@@ -26,31 +26,31 @@ |
||
26 | 26 | |
27 | 27 | # AD? |
28 | 28 | if($auth_settings->type=="AD" || $auth_settings->type=="LDAP" || $auth_settings->type=="NetIQ") { |
29 | - # adLDAP function |
|
30 | - include (dirname(__FILE__) . "/../../../functions/adLDAP/src/adLDAP.php"); |
|
31 | - # set controllers |
|
32 | - $controllers = explode(";", str_replace(" ", "", $parameters->domain_controllers)); |
|
33 | - |
|
34 | - //open connection |
|
35 | - try { |
|
36 | - $adldap = new adLDAP(array( 'base_dn'=>$parameters->base_dn, 'account_suffix'=>@$parameters->account_suffix, |
|
37 | - 'domain_controllers'=>$controllers, 'use_ssl'=>$parameters->use_ssl, |
|
38 | - 'use_tls'=> $parameters->use_tls, 'ad_port'=> $parameters->ad_port |
|
39 | - )); |
|
40 | - //LDAP? |
|
41 | - if($auth_settings->type=="LDAP") $adldap->setUseOpenLDAP(true); |
|
42 | - |
|
43 | - } catch (adLDAPException $e) { |
|
44 | - //catch AD error |
|
45 | - $Result->show("danger", $e, true, true); |
|
46 | - } |
|
47 | - //result |
|
48 | - foreach($controllers as $c) { |
|
49 | - if($fp = @fsockopen($c, $parameters->ad_port, $errno, $errstr, 3)==false) { $Result->show("danger", "$c: $errstr ($errno)", false, true); } |
|
50 | - else { $Result->show("success", "$c: "._('AD network connection ok')."!", false, true); } |
|
51 | - } |
|
29 | + # adLDAP function |
|
30 | + include (dirname(__FILE__) . "/../../../functions/adLDAP/src/adLDAP.php"); |
|
31 | + # set controllers |
|
32 | + $controllers = explode(";", str_replace(" ", "", $parameters->domain_controllers)); |
|
33 | + |
|
34 | + //open connection |
|
35 | + try { |
|
36 | + $adldap = new adLDAP(array( 'base_dn'=>$parameters->base_dn, 'account_suffix'=>@$parameters->account_suffix, |
|
37 | + 'domain_controllers'=>$controllers, 'use_ssl'=>$parameters->use_ssl, |
|
38 | + 'use_tls'=> $parameters->use_tls, 'ad_port'=> $parameters->ad_port |
|
39 | + )); |
|
40 | + //LDAP? |
|
41 | + if($auth_settings->type=="LDAP") $adldap->setUseOpenLDAP(true); |
|
42 | + |
|
43 | + } catch (adLDAPException $e) { |
|
44 | + //catch AD error |
|
45 | + $Result->show("danger", $e, true, true); |
|
46 | + } |
|
47 | + //result |
|
48 | + foreach($controllers as $c) { |
|
49 | + if($fp = @fsockopen($c, $parameters->ad_port, $errno, $errstr, 3)==false) { $Result->show("danger", "$c: $errstr ($errno)", false, true); } |
|
50 | + else { $Result->show("success", "$c: "._('AD network connection ok')."!", false, true); } |
|
51 | + } |
|
52 | 52 | } |
53 | 53 | else { |
54 | - $Result->show("danger", _("Check for not implemented"), true, true); |
|
54 | + $Result->show("danger", _("Check for not implemented"), true, true); |
|
55 | 55 | } |
56 | 56 | ?> |
57 | 57 | \ No newline at end of file |
@@ -38,7 +38,9 @@ |
||
38 | 38 | 'use_tls'=> $parameters->use_tls, 'ad_port'=> $parameters->ad_port |
39 | 39 | )); |
40 | 40 | //LDAP? |
41 | - if($auth_settings->type=="LDAP") $adldap->setUseOpenLDAP(true); |
|
41 | + if($auth_settings->type=="LDAP") { |
|
42 | + $adldap->setUseOpenLDAP(true); |
|
43 | + } |
|
42 | 44 | |
43 | 45 | } catch (adLDAPException $e) { |
44 | 46 | //catch AD error |
@@ -7,50 +7,50 @@ |
||
7 | 7 | |
8 | 8 | |
9 | 9 | /* functions */ |
10 | -require( dirname(__FILE__) . '/../../../functions/functions.php'); |
|
10 | +require(dirname (__FILE__).'/../../../functions/functions.php'); |
|
11 | 11 | |
12 | 12 | # initialize user object |
13 | -$Database = new Database_PDO; |
|
14 | -$User = new User ($Database); |
|
13 | +$Database = new Database_PDO; |
|
14 | +$User = new User ($Database); |
|
15 | 15 | $Admin = new Admin ($Database); |
16 | 16 | $Result = new Result (); |
17 | 17 | |
18 | 18 | # verify that user is logged in |
19 | -$User->check_user_session(); |
|
19 | +$User->check_user_session (); |
|
20 | 20 | |
21 | 21 | # feth settings |
22 | 22 | $auth_settings = $Admin->fetch_object ("usersAuthMethod", "id", $_POST['id']); |
23 | -if($auth_settings===false) { $Result->show("danger", _("Invalid ID"), true, true); } |
|
23 | +if ($auth_settings === false) { $Result->show ("danger", _ ("Invalid ID"), true, true); } |
|
24 | 24 | //set params |
25 | -$parameters = json_decode($auth_settings->params); |
|
25 | +$parameters = json_decode ($auth_settings->params); |
|
26 | 26 | |
27 | 27 | # AD? |
28 | -if($auth_settings->type=="AD" || $auth_settings->type=="LDAP" || $auth_settings->type=="NetIQ") { |
|
28 | +if ($auth_settings->type == "AD" || $auth_settings->type == "LDAP" || $auth_settings->type == "NetIQ") { |
|
29 | 29 | # adLDAP function |
30 | - include (dirname(__FILE__) . "/../../../functions/adLDAP/src/adLDAP.php"); |
|
30 | + include (dirname (__FILE__)."/../../../functions/adLDAP/src/adLDAP.php"); |
|
31 | 31 | # set controllers |
32 | - $controllers = explode(";", str_replace(" ", "", $parameters->domain_controllers)); |
|
32 | + $controllers = explode (";", str_replace (" ", "", $parameters->domain_controllers)); |
|
33 | 33 | |
34 | 34 | //open connection |
35 | 35 | try { |
36 | - $adldap = new adLDAP(array( 'base_dn'=>$parameters->base_dn, 'account_suffix'=>@$parameters->account_suffix, |
|
36 | + $adldap = new adLDAP (array ('base_dn'=>$parameters->base_dn, 'account_suffix'=>@$parameters->account_suffix, |
|
37 | 37 | 'domain_controllers'=>$controllers, 'use_ssl'=>$parameters->use_ssl, |
38 | 38 | 'use_tls'=> $parameters->use_tls, 'ad_port'=> $parameters->ad_port |
39 | 39 | )); |
40 | 40 | //LDAP? |
41 | - if($auth_settings->type=="LDAP") $adldap->setUseOpenLDAP(true); |
|
41 | + if ($auth_settings->type == "LDAP") $adldap->setUseOpenLDAP (true); |
|
42 | 42 | |
43 | 43 | } catch (adLDAPException $e) { |
44 | 44 | //catch AD error |
45 | - $Result->show("danger", $e, true, true); |
|
45 | + $Result->show ("danger", $e, true, true); |
|
46 | 46 | } |
47 | 47 | //result |
48 | - foreach($controllers as $c) { |
|
49 | - if($fp = @fsockopen($c, $parameters->ad_port, $errno, $errstr, 3)==false) { $Result->show("danger", "$c: $errstr ($errno)", false, true); } |
|
50 | - else { $Result->show("success", "$c: "._('AD network connection ok')."!", false, true); } |
|
48 | + foreach ($controllers as $c) { |
|
49 | + if ($fp = @fsockopen ($c, $parameters->ad_port, $errno, $errstr, 3) == false) { $Result->show ("danger", "$c: $errstr ($errno)", false, true); } |
|
50 | + else { $Result->show ("success", "$c: "._ ('AD network connection ok')."!", false, true); } |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | else { |
54 | - $Result->show("danger", _("Check for not implemented"), true, true); |
|
54 | + $Result->show ("danger", _ ("Check for not implemented"), true, true); |
|
55 | 55 | } |
56 | 56 | ?> |
57 | 57 | \ No newline at end of file |
@@ -28,25 +28,25 @@ discard block |
||
28 | 28 | |
29 | 29 | //for adding remove id |
30 | 30 | if($action=="add") { |
31 | - unset($_POST['id']); |
|
31 | + unset($_POST['id']); |
|
32 | 32 | } |
33 | 33 | else { |
34 | - //check id |
|
35 | - if(!is_numeric($_POST['id'])) { $Result->show("danger", _("Invalid ID"), true); } |
|
34 | + //check id |
|
35 | + if(!is_numeric($_POST['id'])) { $Result->show("danger", _("Invalid ID"), true); } |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | # set update query |
39 | 39 | $values = array("id"=>@$_POST['id'], |
40 | - "type"=>$_POST['type'], |
|
41 | - "description"=>@$_POST['description'], |
|
42 | - ); |
|
40 | + "type"=>$_POST['type'], |
|
41 | + "description"=>@$_POST['description'], |
|
42 | + ); |
|
43 | 43 | # add params |
44 | 44 | unset($_POST['id'], $_POST['type'], $_POST['description'], $_POST['action']); |
45 | 45 | $values["params"]=json_encode($_POST); |
46 | 46 | |
47 | 47 | # add - set protected |
48 | 48 | if($action=="add") { |
49 | - $values['protected'] = "No"; |
|
49 | + $values['protected'] = "No"; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | # update |
@@ -55,6 +55,6 @@ discard block |
||
55 | 55 | |
56 | 56 | # if delete also reset all users that have thos auth method |
57 | 57 | if($action=="delete") { |
58 | - $Database->runQuery("update `users` set `authMethod`=1 where `authMethod`= ?;", array($values['id'])); |
|
58 | + $Database->runQuery("update `users` set `authMethod`=1 where `authMethod`= ?;", array($values['id'])); |
|
59 | 59 | } |
60 | 60 | ?> |
61 | 61 | \ No newline at end of file |
@@ -6,55 +6,55 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | /* functions */ |
9 | -require( dirname(__FILE__) . '/../../../functions/functions.php'); |
|
9 | +require(dirname (__FILE__).'/../../../functions/functions.php'); |
|
10 | 10 | |
11 | 11 | # initialize user object |
12 | -$Database = new Database_PDO; |
|
13 | -$User = new User ($Database); |
|
12 | +$Database = new Database_PDO; |
|
13 | +$User = new User ($Database); |
|
14 | 14 | $Admin = new Admin ($Database); |
15 | 15 | $Result = new Result (); |
16 | 16 | |
17 | 17 | # verify that user is logged in |
18 | -$User->check_user_session(); |
|
18 | +$User->check_user_session (); |
|
19 | 19 | |
20 | 20 | # strip input tags |
21 | -$_POST = $Admin->strip_input_tags($_POST); |
|
21 | +$_POST = $Admin->strip_input_tags ($_POST); |
|
22 | 22 | |
23 | 23 | # validate csrf cookie |
24 | -$User->csrf_cookie ("validate", "authmethods", $_POST['csrf_cookie']) === false ? $Result->show("danger", _("Invalid CSRF cookie"), true) : ""; |
|
24 | +$User->csrf_cookie ("validate", "authmethods", $_POST['csrf_cookie']) === false ? $Result->show ("danger", _ ("Invalid CSRF cookie"), true) : ""; |
|
25 | 25 | |
26 | 26 | # get action |
27 | 27 | $action = $_POST['action']; |
28 | 28 | |
29 | 29 | //for adding remove id |
30 | -if($action=="add") { |
|
30 | +if ($action == "add") { |
|
31 | 31 | unset($_POST['id']); |
32 | 32 | } |
33 | 33 | else { |
34 | 34 | //check id |
35 | - if(!is_numeric($_POST['id'])) { $Result->show("danger", _("Invalid ID"), true); } |
|
35 | + if (!is_numeric ($_POST['id'])) { $Result->show ("danger", _ ("Invalid ID"), true); } |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | # set update query |
39 | -$values = array("id"=>@$_POST['id'], |
|
39 | +$values = array ("id"=>@$_POST['id'], |
|
40 | 40 | "type"=>$_POST['type'], |
41 | 41 | "description"=>@$_POST['description'], |
42 | 42 | ); |
43 | 43 | # add params |
44 | 44 | unset($_POST['id'], $_POST['type'], $_POST['description'], $_POST['action']); |
45 | -$values["params"]=json_encode($_POST); |
|
45 | +$values["params"] = json_encode ($_POST); |
|
46 | 46 | |
47 | 47 | # add - set protected |
48 | -if($action=="add") { |
|
48 | +if ($action == "add") { |
|
49 | 49 | $values['protected'] = "No"; |
50 | 50 | } |
51 | 51 | |
52 | 52 | # update |
53 | -if(!$Admin->object_modify("usersAuthMethod", $action, "id", $values)) { $Result->show("danger", _("Failed to edit authentication method"), false); } |
|
54 | -else { $Result->show("success", _("Authentication method updated"), false); } |
|
53 | +if (!$Admin->object_modify ("usersAuthMethod", $action, "id", $values)) { $Result->show ("danger", _ ("Failed to edit authentication method"), false); } |
|
54 | +else { $Result->show ("success", _ ("Authentication method updated"), false); } |
|
55 | 55 | |
56 | 56 | # if delete also reset all users that have thos auth method |
57 | -if($action=="delete") { |
|
58 | - $Database->runQuery("update `users` set `authMethod`=1 where `authMethod`= ?;", array($values['id'])); |
|
57 | +if ($action == "delete") { |
|
58 | + $Database->runQuery ("update `users` set `authMethod`=1 where `authMethod`= ?;", array ($values['id'])); |
|
59 | 59 | } |
60 | 60 | ?> |
61 | 61 | \ No newline at end of file |
@@ -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 = "dc1.domain.local;dc2.domain.local"; |
|
22 | - $method_settings->params->base_dn = "ou=user,o=domain.local"; |
|
23 | - $method_settings->params->account_suffix = ",ou=user,o=domain.local"; |
|
24 | - $method_settings->params->ad_port = 389; |
|
19 | + $method_settings = new StdClass (); |
|
20 | + # set default values |
|
21 | + @$method_settings->params->domain_controllers = "dc1.domain.local;dc2.domain.local"; |
|
22 | + $method_settings->params->base_dn = "ou=user,o=domain.local"; |
|
23 | + $method_settings->params->account_suffix = ",ou=user,o=domain.local"; |
|
24 | + $method_settings->params->ad_port = 389; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | # set delete flag |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | <div class="pContent"> |
36 | 36 | |
37 | 37 | <?php |
38 | - # make sure LDAP is supported ! |
|
39 | - if (!in_array("ldap", get_loaded_extensions())) { $Result->show("danger", _("ldap extension not enabled in php")."!<hr>", false); } |
|
40 | - ?> |
|
38 | + # make sure LDAP is supported ! |
|
39 | + if (!in_array("ldap", get_loaded_extensions())) { $Result->show("danger", _("ldap extension not enabled in php")."!<hr>", false); } |
|
40 | + ?> |
|
41 | 41 | |
42 | 42 | <form id="editAuthMethod" name="editAuthMethod"> |
43 | 43 | <table class="editAuthMethod table table-noborder table-condensed"> |
@@ -163,14 +163,14 @@ discard block |
||
163 | 163 | </div> |
164 | 164 | |
165 | 165 | <?php |
166 | - if($_POST['action']=="delete") { |
|
167 | - # check for mathing users |
|
168 | - $users = $Admin->fetch_multiple_objects ("users", "authMethod", @$method_settings->id); |
|
169 | - if($users!==false) { |
|
170 | - $Result->show("warning", sizeof($users)._(" users have this method for logging in. They will be reset to local auth!"), false); |
|
171 | - } |
|
172 | - } |
|
173 | - ?> |
|
166 | + if($_POST['action']=="delete") { |
|
167 | + # check for mathing users |
|
168 | + $users = $Admin->fetch_multiple_objects ("users", "authMethod", @$method_settings->id); |
|
169 | + if($users!==false) { |
|
170 | + $Result->show("warning", sizeof($users)._(" users have this method for logging in. They will be reset to local auth!"), false); |
|
171 | + } |
|
172 | + } |
|
173 | + ?> |
|
174 | 174 | |
175 | 175 | <!-- Result --> |
176 | 176 | <div class="editAuthMethodResult"></div> |
@@ -174,7 +174,10 @@ |
||
174 | 174 | <div class="pFooter"> |
175 | 175 | <div class="btn-group"> |
176 | 176 | <button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button> |
177 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="editAuthMethodSubmit"><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> |
|
177 | + <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } |
|
178 | +else { print "btn-success"; } ?>" id="editAuthMethodSubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } |
|
179 | +else if ($_POST['action']=="delete") { print "fa-trash-o"; } |
|
180 | +else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
178 | 181 | </div> |
179 | 182 | |
180 | 183 | <?php |
@@ -5,15 +5,15 @@ discard block |
||
5 | 5 | *****************/ |
6 | 6 | |
7 | 7 | # verify that user is logged in |
8 | -$User->check_user_session(); |
|
8 | +$User->check_user_session (); |
|
9 | 9 | |
10 | 10 | # ID must be numeric */ |
11 | -if($_POST['action']!="add") { |
|
12 | - if(!is_numeric($_POST['id'])) { $Result->show("danger", _("Invalid ID"), true, true); } |
|
11 | +if ($_POST['action'] != "add") { |
|
12 | + if (!is_numeric ($_POST['id'])) { $Result->show ("danger", _ ("Invalid ID"), true, true); } |
|
13 | 13 | |
14 | 14 | # feth method settings |
15 | 15 | $method_settings = $Admin->fetch_object ("usersAuthMethod", "id", $_POST['id']); |
16 | - $method_settings->params = json_decode($method_settings->params); |
|
16 | + $method_settings->params = json_decode ($method_settings->params); |
|
17 | 17 | } |
18 | 18 | else { |
19 | 19 | $method_settings = new StdClass (); |
@@ -25,18 +25,18 @@ discard block |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | # set delete flag |
28 | -$delete = $_POST['action']=="delete" ? "disabled" : ""; |
|
28 | +$delete = $_POST['action'] == "delete" ? "disabled" : ""; |
|
29 | 29 | ?> |
30 | 30 | |
31 | 31 | <!-- header --> |
32 | -<div class="pHeader"><?php print _('NetIQ connection settings'); ?></div> |
|
32 | +<div class="pHeader"><?php print _ ('NetIQ connection settings'); ?></div> |
|
33 | 33 | |
34 | 34 | <!-- content --> |
35 | 35 | <div class="pContent"> |
36 | 36 | |
37 | 37 | <?php |
38 | 38 | # make sure LDAP is supported ! |
39 | - if (!in_array("ldap", get_loaded_extensions())) { $Result->show("danger", _("ldap extension not enabled in php")."!<hr>", false); } |
|
39 | + if (!in_array ("ldap", get_loaded_extensions ())) { $Result->show ("danger", _ ("ldap extension not enabled in php")."!<hr>", false); } |
|
40 | 40 | ?> |
41 | 41 | |
42 | 42 | <form id="editAuthMethod" name="editAuthMethod"> |
@@ -44,12 +44,12 @@ discard block |
||
44 | 44 | |
45 | 45 | <!-- description --> |
46 | 46 | <tr> |
47 | - <td><?php print _('Description'); ?></td> |
|
47 | + <td><?php print _ ('Description'); ?></td> |
|
48 | 48 | <td> |
49 | 49 | <input type="text" name="description" class="form-control input-sm" value="<?php print @$method_settings->description; ?>" <?php print $delete; ?>> |
50 | 50 | </td> |
51 | 51 | <td class="base_dn info2"> |
52 | - <?php print _('Set name for authentication method'); ?> |
|
52 | + <?php print _ ('Set name for authentication method'); ?> |
|
53 | 53 | </td> |
54 | 54 | </tr> |
55 | 55 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | <!-- DC --> |
61 | 61 | <tr> |
62 | - <td style="width:130px;"><?php print _('Domain controllers'); ?></td> |
|
62 | + <td style="width:130px;"><?php print _ ('Domain controllers'); ?></td> |
|
63 | 63 | <td style="width:250px;"> |
64 | 64 | <input type="text" name="domain_controllers" class="form-control input-sm" value="<?php print @$method_settings->params->domain_controllers; ?>" <?php print $delete; ?>> |
65 | 65 | <input type="hidden" name="type" value="NetIQ"> |
@@ -67,70 +67,70 @@ discard block |
||
67 | 67 | <input type="hidden" name="action" value="<?php print @$_POST['action']; ?>"> |
68 | 68 | <input type="hidden" name="csrf_cookie" value="<?php print $csrf; ?>"> |
69 | 69 | </td> |
70 | - <td class="info2"><?php print _('Enter domain controllers, separated by ;'); ?> |
|
70 | + <td class="info2"><?php print _ ('Enter domain controllers, separated by ;'); ?> |
|
71 | 71 | </td> |
72 | 72 | </tr> |
73 | 73 | |
74 | 74 | <!-- BasedN --> |
75 | 75 | <tr> |
76 | - <td><?php print _('Base DN'); ?></td> |
|
76 | + <td><?php print _ ('Base DN'); ?></td> |
|
77 | 77 | <td> |
78 | 78 | <input type="text" name="base_dn" class="form-control input-sm" value="<?php print @$method_settings->params->base_dn; ?>" <?php print $delete; ?>> |
79 | 79 | </td> |
80 | 80 | <td class="base_dn info2"> |
81 | - <?php print _('Enter base DN for LDAP'); ?> |
|
81 | + <?php print _ ('Enter base DN for LDAP'); ?> |
|
82 | 82 | </td> |
83 | 83 | </tr> |
84 | 84 | |
85 | 85 | <!-- Account suffix --> |
86 | 86 | <tr> |
87 | - <td><?php print _('Account suffix'); ?></td> |
|
87 | + <td><?php print _ ('Account suffix'); ?></td> |
|
88 | 88 | <td> |
89 | 89 | <input type="text" name="account_suffix" class="form-control input-sm" value="<?php print @$method_settings->params->account_suffix; ?>" <?php print $delete; ?>> |
90 | 90 | </td> |
91 | 91 | <td class="info2"> |
92 | - <?php print _('The account suffix for your domain'); ?> |
|
92 | + <?php print _ ('The account suffix for your domain'); ?> |
|
93 | 93 | </td> |
94 | 94 | </tr> |
95 | 95 | |
96 | 96 | |
97 | 97 | <!-- SSL --> |
98 | 98 | <tr> |
99 | - <td><?php print _('Use SSL'); ?></td> |
|
99 | + <td><?php print _ ('Use SSL'); ?></td> |
|
100 | 100 | <td> |
101 | 101 | <select name="use_ssl" class="form-control input-sm input-w-auto" <?php print $delete; ?>> |
102 | - <option value="0" <?php if(@$method_settings->params->use_ssl == 0) { print 'selected'; } ?>><?php print _('false'); ?></option> |
|
103 | - <option value="1" <?php if(@$method_settings->params->use_ssl == 1) { print 'selected'; } ?>><?php print _('true'); ?></option> |
|
102 | + <option value="0" <?php if (@$method_settings->params->use_ssl == 0) { print 'selected'; } ?>><?php print _ ('false'); ?></option> |
|
103 | + <option value="1" <?php if (@$method_settings->params->use_ssl == 1) { print 'selected'; } ?>><?php print _ ('true'); ?></option> |
|
104 | 104 | </select> |
105 | 105 | </td> |
106 | 106 | <td class="info2"> |
107 | - <?php print _('Use SSL (LDAPS), your server needs to be setup (default: false)'); ?><br> |
|
107 | + <?php print _ ('Use SSL (LDAPS), your server needs to be setup (default: false)'); ?><br> |
|
108 | 108 | </td> |
109 | 109 | </tr> |
110 | 110 | |
111 | 111 | <!-- TLS --> |
112 | 112 | <tr> |
113 | - <td><?php print _('Use TLS'); ?></td> |
|
113 | + <td><?php print _ ('Use TLS'); ?></td> |
|
114 | 114 | <td> |
115 | 115 | <select name="use_tls" class="form-control input-sm input-w-auto" <?php print $delete; ?>> |
116 | - <option value="0" <?php if(@$method_settings->params->use_tls == 0) { print 'selected'; } ?>><?php print _('false'); ?></option> |
|
117 | - <option value="1" <?php if(@$method_settings->params->use_tls == 1) { print 'selected'; } ?>><?php print _('true'); ?></option> |
|
116 | + <option value="0" <?php if (@$method_settings->params->use_tls == 0) { print 'selected'; } ?>><?php print _ ('false'); ?></option> |
|
117 | + <option value="1" <?php if (@$method_settings->params->use_tls == 1) { print 'selected'; } ?>><?php print _ ('true'); ?></option> |
|
118 | 118 | </select> |
119 | 119 | </td> |
120 | 120 | <td class="info2"> |
121 | - <?php print _('If you wish to use TLS you should ensure that useSSL is set to false and vice-versa (default: false)'); ?> |
|
121 | + <?php print _ ('If you wish to use TLS you should ensure that useSSL is set to false and vice-versa (default: false)'); ?> |
|
122 | 122 | </td> |
123 | 123 | </tr> |
124 | 124 | |
125 | 125 | |
126 | 126 | <!-- AD port --> |
127 | 127 | <tr> |
128 | - <td><?php print _('AD port'); ?></td> |
|
128 | + <td><?php print _ ('AD port'); ?></td> |
|
129 | 129 | <td> |
130 | 130 | <input type="text" name="ad_port" class="form-control input-sm input-w-100" value="<?php print @$method_settings->params->ad_port; ?>" <?php print $delete; ?>> |
131 | 131 | </td> |
132 | 132 | <td class="port info2"> |
133 | - <?php print _('The default port for LDAP non-SSL connections'); ?> |
|
133 | + <?php print _ ('The default port for LDAP non-SSL connections'); ?> |
|
134 | 134 | </td> |
135 | 135 | </tr> |
136 | 136 | |
@@ -140,13 +140,13 @@ discard block |
||
140 | 140 | </tr> |
141 | 141 | <!-- Username --> |
142 | 142 | <tr> |
143 | - <td><?php print _('Domain account'); ?></td> |
|
143 | + <td><?php print _ ('Domain account'); ?></td> |
|
144 | 144 | <td> |
145 | - <input type="text" name="adminUsername" class="form-control input-sm" style="margin-bottom:5px;" placeholder="<?php print _('Username'); ?>" value="<?php print @$method_settings->params->adminUsername; ?>" <?php print $delete; ?>> |
|
146 | - <input type="password" name="adminPassword" class="form-control input-sm" placeholder="<?php print _('Password'); ?>" value="<?php print @$method_settings->params->adminPassword; ?>" <?php print $delete; ?>> |
|
145 | + <input type="text" name="adminUsername" class="form-control input-sm" style="margin-bottom:5px;" placeholder="<?php print _ ('Username'); ?>" value="<?php print @$method_settings->params->adminUsername; ?>" <?php print $delete; ?>> |
|
146 | + <input type="password" name="adminPassword" class="form-control input-sm" placeholder="<?php print _ ('Password'); ?>" value="<?php print @$method_settings->params->adminPassword; ?>" <?php print $delete; ?>> |
|
147 | 147 | </td> |
148 | 148 | <td class="info2"> |
149 | - <?php print _('Domain account for search operations (optional)'); ?> |
|
149 | + <?php print _ ('Domain account for search operations (optional)'); ?> |
|
150 | 150 | </td> |
151 | 151 | </tr> |
152 | 152 | |
@@ -158,16 +158,16 @@ discard block |
||
158 | 158 | <!-- footer --> |
159 | 159 | <div class="pFooter"> |
160 | 160 | <div class="btn-group"> |
161 | - <button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button> |
|
162 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="editAuthMethodSubmit"><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> |
|
161 | + <button class="btn btn-sm btn-default hidePopups"><?php print _ ('Cancel'); ?></button> |
|
162 | + <button class="btn btn-sm btn-default <?php if ($_POST['action'] == "delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="editAuthMethodSubmit"><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> |
|
163 | 163 | </div> |
164 | 164 | |
165 | 165 | <?php |
166 | - if($_POST['action']=="delete") { |
|
166 | + if ($_POST['action'] == "delete") { |
|
167 | 167 | # check for mathing users |
168 | 168 | $users = $Admin->fetch_multiple_objects ("users", "authMethod", @$method_settings->id); |
169 | - if($users!==false) { |
|
170 | - $Result->show("warning", sizeof($users)._(" users have this method for logging in. They will be reset to local auth!"), false); |
|
169 | + if ($users !== false) { |
|
170 | + $Result->show ("warning", sizeof ($users)._ (" users have this method for logging in. They will be reset to local auth!"), false); |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | ?> |
@@ -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> |
@@ -174,7 +174,10 @@ |
||
174 | 174 | <div class="pFooter"> |
175 | 175 | <div class="btn-group"> |
176 | 176 | <button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button> |
177 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="editAuthMethodSubmit"><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> |
|
177 | + <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } |
|
178 | +else { print "btn-success"; } ?>" id="editAuthMethodSubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } |
|
179 | +else if ($_POST['action']=="delete") { print "fa-trash-o"; } |
|
180 | +else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
178 | 181 | </div> |
179 | 182 | |
180 | 183 | <?php |
@@ -5,15 +5,15 @@ discard block |
||
5 | 5 | *****************/ |
6 | 6 | |
7 | 7 | # verify that user is logged in |
8 | -$User->check_user_session(); |
|
8 | +$User->check_user_session (); |
|
9 | 9 | |
10 | 10 | # ID must be numeric */ |
11 | -if($_POST['action']!="add") { |
|
12 | - if(!is_numeric($_POST['id'])) { $Result->show("danger", _("Invalid ID"), true, true); } |
|
11 | +if ($_POST['action'] != "add") { |
|
12 | + if (!is_numeric ($_POST['id'])) { $Result->show ("danger", _ ("Invalid ID"), true, true); } |
|
13 | 13 | |
14 | 14 | # feth method settings |
15 | 15 | $method_settings = $Admin->fetch_object ("usersAuthMethod", "id", $_POST['id']); |
16 | - $method_settings->params = json_decode($method_settings->params); |
|
16 | + $method_settings->params = json_decode ($method_settings->params); |
|
17 | 17 | } |
18 | 18 | else { |
19 | 19 | $method_settings = new StdClass (); |
@@ -25,11 +25,11 @@ discard block |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | # set delete flag |
28 | -$delete = $_POST['action']=="delete" ? "disabled" : ""; |
|
28 | +$delete = $_POST['action'] == "delete" ? "disabled" : ""; |
|
29 | 29 | ?> |
30 | 30 | |
31 | 31 | <!-- header --> |
32 | -<div class="pHeader"><?php print _('Radius connection settings'); ?></div> |
|
32 | +<div class="pHeader"><?php print _ ('Radius connection settings'); ?></div> |
|
33 | 33 | |
34 | 34 | <!-- content --> |
35 | 35 | <div class="pContent"> |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | |
40 | 40 | <!-- description --> |
41 | 41 | <tr> |
42 | - <td><?php print _('Description'); ?></td> |
|
42 | + <td><?php print _ ('Description'); ?></td> |
|
43 | 43 | <td> |
44 | 44 | <input type="text" name="description" class="form-control input-sm" value="<?php print @$method_settings->description; ?>" <?php print $delete; ?>> |
45 | 45 | </td> |
46 | 46 | <td class="base_dn info2"> |
47 | - <?php print _('Set name for authentication method'); ?> |
|
47 | + <?php print _ ('Set name for authentication method'); ?> |
|
48 | 48 | </td> |
49 | 49 | </tr> |
50 | 50 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | <!-- Server --> |
56 | 56 | <tr> |
57 | - <td style="width:130px;"><?php print _('Radius server'); ?></td> |
|
57 | + <td style="width:130px;"><?php print _ ('Radius server'); ?></td> |
|
58 | 58 | <td style="width:250px;"> |
59 | 59 | <input type="text" name="hostname" class="form-control input-sm" value="<?php print @$method_settings->params->hostname; ?>" <?php print $delete; ?>> |
60 | 60 | <input type="hidden" name="type" value="Radius"> |
@@ -62,59 +62,59 @@ discard block |
||
62 | 62 | <input type="hidden" name="action" value="<?php print @$_POST['action']; ?>"> |
63 | 63 | <input type="hidden" name="csrf_cookie" value="<?php print $csrf; ?>"> |
64 | 64 | </td> |
65 | - <td class="info2"><?php print _('Enter Radius server'); ?> |
|
65 | + <td class="info2"><?php print _ ('Enter Radius server'); ?> |
|
66 | 66 | </td> |
67 | 67 | </tr> |
68 | 68 | |
69 | 69 | <!-- secret --> |
70 | 70 | <tr> |
71 | - <td><?php print _('Secret'); ?></td> |
|
71 | + <td><?php print _ ('Secret'); ?></td> |
|
72 | 72 | <td> |
73 | 73 | <input type="password" name="secret" class="form-control input-sm" value="<?php print @$method_settings->params->secret; ?>" <?php print $delete; ?>> |
74 | 74 | </td> |
75 | 75 | <td class="base_dn info2"> |
76 | - <?php print _('Enter radius secret'); ?> |
|
76 | + <?php print _ ('Enter radius secret'); ?> |
|
77 | 77 | </td> |
78 | 78 | </tr> |
79 | 79 | |
80 | 80 | <!-- port --> |
81 | 81 | <tr> |
82 | - <td><?php print _('Port'); ?></td> |
|
82 | + <td><?php print _ ('Port'); ?></td> |
|
83 | 83 | <td> |
84 | 84 | <input type="text" name="port" class="form-control input-sm" value="<?php print @$method_settings->params->port; ?>" <?php print $delete; ?>> |
85 | 85 | </td> |
86 | 86 | <td class="base_dn info2"> |
87 | - <?php print _('Enter radius port (default 1812)'); ?> |
|
87 | + <?php print _ ('Enter radius port (default 1812)'); ?> |
|
88 | 88 | </td> |
89 | 89 | </tr> |
90 | 90 | |
91 | 91 | <!-- port --> |
92 | 92 | <tr> |
93 | - <td><?php print _('Suffix'); ?></td> |
|
93 | + <td><?php print _ ('Suffix'); ?></td> |
|
94 | 94 | <td> |
95 | 95 | <input type="text" name="suffix" class="form-control input-sm" value="<?php print @$method_settings->params->suffix; ?>" <?php print $delete; ?>> |
96 | 96 | </td> |
97 | 97 | <td class="base_dn info2"> |
98 | - <?php print _('Enter suffix'); ?> |
|
98 | + <?php print _ ('Enter suffix'); ?> |
|
99 | 99 | </td> |
100 | 100 | </tr> |
101 | 101 | |
102 | 102 | <!-- timeout --> |
103 | 103 | <tr> |
104 | - <td><?php print _('Timeout'); ?></td> |
|
104 | + <td><?php print _ ('Timeout'); ?></td> |
|
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>"; } |
|
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 | 112 | } |
113 | 113 | ?> |
114 | 114 | </select> |
115 | 115 | </td> |
116 | 116 | <td class="base_dn info2"> |
117 | - <?php print _('Set timeout in seconds'); ?> |
|
117 | + <?php print _ ('Set timeout in seconds'); ?> |
|
118 | 118 | </td> |
119 | 119 | </tr> |
120 | 120 | |
@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | |
124 | 124 | <?php |
125 | 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); |
|
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 | 129 | } |
130 | 130 | ?> |
131 | 131 | </div> |
@@ -134,16 +134,16 @@ discard block |
||
134 | 134 | <!-- footer --> |
135 | 135 | <div class="pFooter"> |
136 | 136 | <div class="btn-group"> |
137 | - <button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button> |
|
138 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="editAuthMethodSubmit"><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> |
|
137 | + <button class="btn btn-sm btn-default hidePopups"><?php print _ ('Cancel'); ?></button> |
|
138 | + <button class="btn btn-sm btn-default <?php if ($_POST['action'] == "delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="editAuthMethodSubmit"><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 | 139 | </div> |
140 | 140 | |
141 | 141 | <?php |
142 | 142 | # check for mathing users |
143 | - if($_POST['action']=="delete") { |
|
143 | + if ($_POST['action'] == "delete") { |
|
144 | 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); |
|
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 | 147 | } |
148 | 148 | } |
149 | 149 | ?> |
@@ -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> |
@@ -174,7 +174,10 @@ |
||
174 | 174 | <div class="pFooter"> |
175 | 175 | <div class="btn-group"> |
176 | 176 | <button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button> |
177 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="editAuthMethodSubmit"><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> |
|
177 | + <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } |
|
178 | +else { print "btn-success"; } ?>" id="editAuthMethodSubmit"><i class="fa <?php if($_POST['action']=="add") { print "fa-plus"; } |
|
179 | +else if ($_POST['action']=="delete") { print "fa-trash-o"; } |
|
180 | +else { print "fa-check"; } ?>"></i> <?php print ucwords(_($_POST['action'])); ?></button> |
|
178 | 181 | </div> |
179 | 182 | |
180 | 183 | <?php |
@@ -5,15 +5,15 @@ discard block |
||
5 | 5 | *****************/ |
6 | 6 | |
7 | 7 | # verify that user is logged in |
8 | -$User->check_user_session(); |
|
8 | +$User->check_user_session (); |
|
9 | 9 | |
10 | 10 | # ID must be numeric */ |
11 | -if($_POST['action']!="add") { |
|
12 | - if(!is_numeric($_POST['id'])) { $Result->show("danger", _("Invalid ID"), true, true); } |
|
11 | +if ($_POST['action'] != "add") { |
|
12 | + if (!is_numeric ($_POST['id'])) { $Result->show ("danger", _ ("Invalid ID"), true, true); } |
|
13 | 13 | |
14 | 14 | # feth method settings |
15 | 15 | $method_settings = $Admin->fetch_object ("usersAuthMethod", "id", $_POST['id']); |
16 | - $method_settings->params = json_decode($method_settings->params); |
|
16 | + $method_settings->params = json_decode ($method_settings->params); |
|
17 | 17 | } |
18 | 18 | else { |
19 | 19 | $method_settings = new StdClass (); |
@@ -25,11 +25,11 @@ discard block |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | # set delete flag |
28 | -$delete = $_POST['action']=="delete" ? "disabled" : ""; |
|
28 | +$delete = $_POST['action'] == "delete" ? "disabled" : ""; |
|
29 | 29 | ?> |
30 | 30 | |
31 | 31 | <!-- header --> |
32 | -<div class="pHeader"><?php print _('LDAP connection settings'); ?></div> |
|
32 | +<div class="pHeader"><?php print _ ('LDAP connection settings'); ?></div> |
|
33 | 33 | |
34 | 34 | <script> |
35 | 35 | $( "select#ldap_security" ).change(function () { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | <?php |
48 | 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); } |
|
49 | + if (!in_array ("ldap", get_loaded_extensions ())) { $Result->show ("danger", _ ("ldap extension not enabled in php")."!<hr>", false); } |
|
50 | 50 | ?> |
51 | 51 | |
52 | 52 | <form id="editAuthMethod" name="editAuthMethod"> |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | |
55 | 55 | <!-- description --> |
56 | 56 | <tr> |
57 | - <td><?php print _('Description'); ?></td> |
|
57 | + <td><?php print _ ('Description'); ?></td> |
|
58 | 58 | <td> |
59 | 59 | <input type="text" name="description" class="form-control input-sm" value="<?php print @$method_settings->description; ?>" <?php print $delete; ?>> |
60 | 60 | </td> |
61 | 61 | <td class="base_dn info2"> |
62 | - <?php print _('Set name for authentication method'); ?> |
|
62 | + <?php print _ ('Set name for authentication method'); ?> |
|
63 | 63 | </td> |
64 | 64 | </tr> |
65 | 65 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | <!-- DC --> |
71 | 71 | <tr> |
72 | - <td style="width:130px;"><?php print _('LDAP servers'); ?></td> |
|
72 | + <td style="width:130px;"><?php print _ ('LDAP servers'); ?></td> |
|
73 | 73 | <td style="width:250px;"> |
74 | 74 | <input type="text" name="domain_controllers" class="form-control input-sm" value="<?php print @$method_settings->params->domain_controllers; ?>" <?php print $delete; ?>> |
75 | 75 | <input type="hidden" name="type" value="LDAP"> |
@@ -77,66 +77,66 @@ discard block |
||
77 | 77 | <input type="hidden" name="action" value="<?php print @$_POST['action']; ?>"> |
78 | 78 | <input type="hidden" name="csrf_cookie" value="<?php print $csrf; ?>"> |
79 | 79 | </td> |
80 | - <td class="info2"><?php print _('LDAP hosts, separated by a semicolon (;)'); ?> |
|
80 | + <td class="info2"><?php print _ ('LDAP hosts, separated by a semicolon (;)'); ?> |
|
81 | 81 | </td> |
82 | 82 | </tr> |
83 | 83 | |
84 | 84 | <!-- BaseDN --> |
85 | 85 | <tr> |
86 | - <td><?php print _('Base DN'); ?></td> |
|
86 | + <td><?php print _ ('Base DN'); ?></td> |
|
87 | 87 | <td> |
88 | 88 | <input type="text" name="base_dn" class="form-control input-sm" value="<?php print @$method_settings->params->base_dn; ?>" <?php print $delete; ?>> |
89 | 89 | </td> |
90 | 90 | <td class="base_dn info2"> |
91 | - <?php print _('Base DN for your directory'); ?> |
|
91 | + <?php print _ ('Base DN for your directory'); ?> |
|
92 | 92 | </td> |
93 | 93 | </tr> |
94 | 94 | |
95 | 95 | <!-- UsersDN --> |
96 | 96 | <tr> |
97 | - <td><?php print _('Users DN'); ?></td> |
|
97 | + <td><?php print _ ('Users DN'); ?></td> |
|
98 | 98 | <td> |
99 | 99 | <input type="text" name="users_base_dn" class="form-control input-sm" value="<?php print @$method_settings->params->users_base_dn; ?>" <?php print $delete; ?>> |
100 | 100 | </td> |
101 | 101 | <td class="users_base_dn info2"> |
102 | - <?php print _('Base DN for your users, if different from the base DN above.'); ?> |
|
102 | + <?php print _ ('Base DN for your users, if different from the base DN above.'); ?> |
|
103 | 103 | </td> |
104 | 104 | </tr> |
105 | 105 | |
106 | 106 | <!-- UIDAttr --> |
107 | 107 | <tr> |
108 | - <td><?php print _('UID Attribute'); ?></td> |
|
108 | + <td><?php print _ ('UID Attribute'); ?></td> |
|
109 | 109 | <td> |
110 | 110 | <input type="text" name="uid_attr" class="form-control input-sm" value="<?php print @$method_settings->params->uid_attr; ?>" <?php print $delete; ?>> |
111 | 111 | </td> |
112 | 112 | <td class="uid_attr_dn info2"> |
113 | - <?php print _('LDAP uid naming attribute for users, e.g. "uid" or "cn"'); ?> |
|
113 | + <?php print _ ('LDAP uid naming attribute for users, e.g. "uid" or "cn"'); ?> |
|
114 | 114 | </td> |
115 | 115 | </tr> |
116 | 116 | |
117 | 117 | <!-- TLS --> |
118 | 118 | <tr> |
119 | - <td><?php print _('LDAP Security Type'); ?></td> |
|
119 | + <td><?php print _ ('LDAP Security Type'); ?></td> |
|
120 | 120 | <td> |
121 | 121 | <select id='ldap_security' name="ldap_security" class="form-control input-sm input-w-auto" <?php print $delete; ?>> |
122 | - <option name="ldap_security" class="form-control input-sm input-w-auto" value="tls" <?php if(@$method_settings->params->ldap_security == 'tls') { print 'selected'; } ?>>TLS</option> |
|
123 | - <option name="ldap_security" class="form-control input-sm input-w-auto" value="ssl" <?php if(@$method_settings->params->ldap_security == 'ssl') { print 'selected'; } ?>>SSL</option> |
|
124 | - <option name="ldap_security" class="form-control input-sm input-w-auto" value="none" <?php if(@$method_settings->params->ldap_security == 'none') { print 'selected'; } ?>>None</option> |
|
122 | + <option name="ldap_security" class="form-control input-sm input-w-auto" value="tls" <?php if (@$method_settings->params->ldap_security == 'tls') { print 'selected'; } ?>>TLS</option> |
|
123 | + <option name="ldap_security" class="form-control input-sm input-w-auto" value="ssl" <?php if (@$method_settings->params->ldap_security == 'ssl') { print 'selected'; } ?>>SSL</option> |
|
124 | + <option name="ldap_security" class="form-control input-sm input-w-auto" value="none" <?php if (@$method_settings->params->ldap_security == 'none') { print 'selected'; } ?>>None</option> |
|
125 | 125 | </select> |
126 | 126 | </td> |
127 | 127 | <td class="info2"> |
128 | - <?php print _('SSL, TLS, or None (default: TLS)'); ?> |
|
128 | + <?php print _ ('SSL, TLS, or None (default: TLS)'); ?> |
|
129 | 129 | </td> |
130 | 130 | </tr> |
131 | 131 | |
132 | 132 | <!-- LDAP port --> |
133 | 133 | <tr> |
134 | - <td><?php print _('LDAP port'); ?></td> |
|
134 | + <td><?php print _ ('LDAP port'); ?></td> |
|
135 | 135 | <td> |
136 | 136 | <input type="text" id="ad_port" name="ad_port" class="form-control input-sm input-w-100" value="<?php print @$method_settings->params->ad_port; ?>" <?php print $delete; ?>> |
137 | 137 | </td> |
138 | 138 | <td class="port info2"> |
139 | - <?php print _('Listening port for your LDAP service. TLS/unencrypted Default: 389 <br /> SSL Default: 636'); ?> |
|
139 | + <?php print _ ('Listening port for your LDAP service. TLS/unencrypted Default: 389 <br /> SSL Default: 636'); ?> |
|
140 | 140 | </td> |
141 | 141 | </tr> |
142 | 142 | |
@@ -145,23 +145,23 @@ discard block |
||
145 | 145 | </tr> |
146 | 146 | <!-- Username --> |
147 | 147 | <tr> |
148 | - <td><?php print _('Bind user'); ?></td> |
|
148 | + <td><?php print _ ('Bind user'); ?></td> |
|
149 | 149 | <td> |
150 | - <input type="text" name="adminUsername" class="form-control input-sm" style="margin-bottom:5px;" placeholder="<?php print _('Username'); ?>" value="<?php print @$method_settings->params->adminUsername; ?>" <?php print $delete; ?>> |
|
150 | + <input type="text" name="adminUsername" class="form-control input-sm" style="margin-bottom:5px;" placeholder="<?php print _ ('Username'); ?>" value="<?php print @$method_settings->params->adminUsername; ?>" <?php print $delete; ?>> |
|
151 | 151 | </td> |
152 | 152 | <td class="info2"> |
153 | - <?php print _('User DN to bind as for search operations (optional). '); ?> |
|
153 | + <?php print _ ('User DN to bind as for search operations (optional). '); ?> |
|
154 | 154 | </td> |
155 | 155 | </tr> |
156 | 156 | |
157 | 157 | <!-- Username --> |
158 | 158 | <tr> |
159 | - <td><?php print _('Bind password'); ?></td> |
|
159 | + <td><?php print _ ('Bind password'); ?></td> |
|
160 | 160 | <td> |
161 | - <input type="password" name="adminPassword" class="form-control input-sm" placeholder="<?php print _('Password'); ?>" value="<?php print @$method_settings->params->adminPassword; ?>" <?php print $delete; ?>> |
|
161 | + <input type="password" name="adminPassword" class="form-control input-sm" placeholder="<?php print _ ('Password'); ?>" value="<?php print @$method_settings->params->adminPassword; ?>" <?php print $delete; ?>> |
|
162 | 162 | </td> |
163 | 163 | <td class="info2"> |
164 | - <?php print _('Password for the bind account (only required if bind user is set).'); ?> |
|
164 | + <?php print _ ('Password for the bind account (only required if bind user is set).'); ?> |
|
165 | 165 | </td> |
166 | 166 | </tr> |
167 | 167 | |
@@ -173,16 +173,16 @@ discard block |
||
173 | 173 | <!-- footer --> |
174 | 174 | <div class="pFooter"> |
175 | 175 | <div class="btn-group"> |
176 | - <button class="btn btn-sm btn-default hidePopups"><?php print _('Cancel'); ?></button> |
|
177 | - <button class="btn btn-sm btn-default <?php if($_POST['action']=="delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="editAuthMethodSubmit"><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> |
|
176 | + <button class="btn btn-sm btn-default hidePopups"><?php print _ ('Cancel'); ?></button> |
|
177 | + <button class="btn btn-sm btn-default <?php if ($_POST['action'] == "delete") { print "btn-danger"; } else { print "btn-success"; } ?>" id="editAuthMethodSubmit"><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> |
|
178 | 178 | </div> |
179 | 179 | |
180 | 180 | <?php |
181 | - if($_POST['action']=="delete") { |
|
181 | + if ($_POST['action'] == "delete") { |
|
182 | 182 | # check for mathing users |
183 | 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); |
|
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 | 186 | } |
187 | 187 | } |
188 | 188 | ?> |
@@ -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 |
@@ -1,28 +1,28 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* functions */ |
4 | -require( dirname(__FILE__) . '/../../../functions/functions.php'); |
|
4 | +require(dirname (__FILE__).'/../../../functions/functions.php'); |
|
5 | 5 | |
6 | 6 | # initialize user object |
7 | -$Database = new Database_PDO; |
|
8 | -$User = new User ($Database); |
|
7 | +$Database = new Database_PDO; |
|
8 | +$User = new User ($Database); |
|
9 | 9 | $Admin = new Admin ($Database); |
10 | 10 | $Result = new Result (); |
11 | -$Log = new Logging ($Database, $User->settings); |
|
11 | +$Log = new Logging ($Database, $User->settings); |
|
12 | 12 | |
13 | 13 | # verify that user is logged in |
14 | -$User->check_user_session(); |
|
14 | +$User->check_user_session (); |
|
15 | 15 | |
16 | 16 | # create csrf token |
17 | 17 | $csrf = $User->csrf_cookie ("create", "authmethods"); |
18 | 18 | |
19 | 19 | # if edit check if protected? |
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); } |
|
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); } |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | # route to proper auth method editing |
26 | -if(!file_exists(dirname(__FILE__)."/edit-$_POST[type].php")) { $Result->show("danger", _("Invalid method type"), true, true); } |
|
27 | -else { include("edit-$_POST[type].php"); } |
|
26 | +if (!file_exists (dirname (__FILE__)."/edit-$_POST[type].php")) { $Result->show ("danger", _ ("Invalid method type"), true, true); } |
|
27 | +else { include("edit-$_POST[type].php"); } |
|
28 | 28 | ?> |
29 | 29 | \ No newline at end of file |
@@ -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 | ?> |
@@ -39,12 +39,16 @@ |
||
39 | 39 | if(!is_numeric($_POST['vlanMax'])) { $Result->show("danger", _("Invalid value for Max VLAN number"), true); } |
40 | 40 | |
41 | 41 | //verify snmp support |
42 | -if ($Admin->verify_checkbox(@$_POST['enableSNMP'])==1) |
|
43 | -if (!in_array("snmp", get_loaded_extensions())) { $Result->show("danger", _("Missing snmp support in php"), true); } |
|
42 | +if ($Admin->verify_checkbox(@$_POST['enableSNMP'])==1) { |
|
43 | + if (!in_array("snmp", get_loaded_extensions())) { $Result->show("danger", _("Missing snmp support in php"), true); |
|
44 | +} |
|
45 | +} |
|
44 | 46 | |
45 | 47 | //verify racktables gd support |
46 | -if ($Admin->verify_checkbox(@$_POST['enableRACK'])==1) |
|
47 | -if (!in_array("gd", get_loaded_extensions())) { $Result->show("danger", _("Missing gd support in php"), true); } |
|
48 | +if ($Admin->verify_checkbox(@$_POST['enableRACK'])==1) { |
|
49 | + if (!in_array("gd", get_loaded_extensions())) { $Result->show("danger", _("Missing gd support in php"), true); |
|
50 | +} |
|
51 | +} |
|
48 | 52 | |
49 | 53 | # set update values |
50 | 54 | $values = array("id"=>1, |
@@ -5,49 +5,49 @@ discard block |
||
5 | 5 | **************************/ |
6 | 6 | |
7 | 7 | /* functions */ |
8 | -require( dirname(__FILE__) . '/../../../functions/functions.php'); |
|
8 | +require(dirname (__FILE__).'/../../../functions/functions.php'); |
|
9 | 9 | |
10 | 10 | # initialize user object |
11 | -$Database = new Database_PDO; |
|
12 | -$User = new User ($Database); |
|
11 | +$Database = new Database_PDO; |
|
12 | +$User = new User ($Database); |
|
13 | 13 | $Admin = new Admin ($Database); |
14 | 14 | $Result = new Result (); |
15 | 15 | |
16 | 16 | # verify that user is logged in |
17 | -$User->check_user_session(); |
|
17 | +$User->check_user_session (); |
|
18 | 18 | |
19 | 19 | # validate csrf cookie |
20 | -$User->csrf_cookie ("validate", "settings", $_POST['csrf_cookie']) === false ? $Result->show("danger", _("Invalid CSRF cookie"), true) : ""; |
|
20 | +$User->csrf_cookie ("validate", "settings", $_POST['csrf_cookie']) === false ? $Result->show ("danger", _ ("Invalid CSRF cookie"), true) : ""; |
|
21 | 21 | |
22 | 22 | |
23 | 23 | //check for http/https |
24 | -if ( (strpos($_POST['siteURL'],'http://') !== false) || (strpos($_POST['siteURL'],'https://') !== false) ) {} |
|
25 | -else { $_POST['siteURL'] = "http://".$_POST['siteURL']; } |
|
24 | +if ((strpos ($_POST['siteURL'], 'http://') !== false) || (strpos ($_POST['siteURL'], 'https://') !== false)) {} |
|
25 | +else { $_POST['siteURL'] = "http://".$_POST['siteURL']; } |
|
26 | 26 | |
27 | 27 | //verify ping status fields |
28 | -$_POST['pingStatus'] = str_replace(" ", "", $_POST['pingStatus']); //remove possible spaces |
|
29 | -$_POST['pingStatus'] = str_replace(",", ";", $_POST['pingStatus']); //change possible , for ; |
|
30 | -$statuses = explode(";", $_POST['pingStatus']); |
|
28 | +$_POST['pingStatus'] = str_replace (" ", "", $_POST['pingStatus']); //remove possible spaces |
|
29 | +$_POST['pingStatus'] = str_replace (",", ";", $_POST['pingStatus']); //change possible , for ; |
|
30 | +$statuses = explode (";", $_POST['pingStatus']); |
|
31 | 31 | |
32 | -if(sizeof($statuses)!=2) { $Result->show("danger", _("Invalid ping status intervals"), true); } |
|
33 | -if(!is_numeric($statuses[0]) || !is_numeric($statuses[1])) { $Result->show("danger", _("Invalid ping status intervals"), true); } |
|
32 | +if (sizeof ($statuses) != 2) { $Result->show ("danger", _ ("Invalid ping status intervals"), true); } |
|
33 | +if (!is_numeric ($statuses[0]) || !is_numeric ($statuses[1])) { $Result->show ("danger", _ ("Invalid ping status intervals"), true); } |
|
34 | 34 | |
35 | 35 | //verify email |
36 | -if(filter_var($_POST['siteAdminMail'], FILTER_VALIDATE_EMAIL) === false) { $Result->show("danger", _("Invalid email"), true); } |
|
36 | +if (filter_var ($_POST['siteAdminMail'], FILTER_VALIDATE_EMAIL) === false) { $Result->show ("danger", _ ("Invalid email"), true); } |
|
37 | 37 | |
38 | 38 | //verify numbers |
39 | -if(!is_numeric($_POST['vlanMax'])) { $Result->show("danger", _("Invalid value for Max VLAN number"), true); } |
|
39 | +if (!is_numeric ($_POST['vlanMax'])) { $Result->show ("danger", _ ("Invalid value for Max VLAN number"), true); } |
|
40 | 40 | |
41 | 41 | //verify snmp support |
42 | -if ($Admin->verify_checkbox(@$_POST['enableSNMP'])==1) |
|
43 | -if (!in_array("snmp", get_loaded_extensions())) { $Result->show("danger", _("Missing snmp support in php"), true); } |
|
42 | +if ($Admin->verify_checkbox (@$_POST['enableSNMP']) == 1) |
|
43 | +if (!in_array ("snmp", get_loaded_extensions ())) { $Result->show ("danger", _ ("Missing snmp support in php"), true); } |
|
44 | 44 | |
45 | 45 | //verify racktables gd support |
46 | -if ($Admin->verify_checkbox(@$_POST['enableRACK'])==1) |
|
47 | -if (!in_array("gd", get_loaded_extensions())) { $Result->show("danger", _("Missing gd support in php"), true); } |
|
46 | +if ($Admin->verify_checkbox (@$_POST['enableRACK']) == 1) |
|
47 | +if (!in_array ("gd", get_loaded_extensions ())) { $Result->show ("danger", _ ("Missing gd support in php"), true); } |
|
48 | 48 | |
49 | 49 | # set update values |
50 | -$values = array("id"=>1, |
|
50 | +$values = array ("id"=>1, |
|
51 | 51 | //site settings |
52 | 52 | "siteTitle"=>@$_POST['siteTitle'], |
53 | 53 | "siteDomain"=>@$_POST['siteDomain'], |
@@ -60,23 +60,23 @@ discard block |
||
60 | 60 | "siteAdminName"=>@$_POST['siteAdminName'], |
61 | 61 | "siteAdminMail"=>@$_POST['siteAdminMail'], |
62 | 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']), |
|
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 | 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']), |
|
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 | 77 | "log"=>@$_POST['log'], |
78 | 78 | //display |
79 | - "donate"=>$Admin->verify_checkbox(@$_POST['donate']), |
|
79 | + "donate"=>$Admin->verify_checkbox (@$_POST['donate']), |
|
80 | 80 | "visualLimit"=>@$_POST['visualLimit'], |
81 | 81 | "subnetOrdering"=>@$_POST['subnetOrdering'], |
82 | 82 | "subnetView"=>@$_POST['subnetView'], |
@@ -87,6 +87,6 @@ discard block |
||
87 | 87 | "scanFPingPath"=>@$_POST['scanFPingPath'], |
88 | 88 | "scanMaxThreads"=>@$_POST['scanMaxThreads'] |
89 | 89 | ); |
90 | -if(!$Admin->object_modify("settings", "edit", "id", $values)) { $Result->show("danger", _("Cannot update settings"), true); } |
|
91 | -else { $Result->show("success", _("Settings updated successfully"), true); } |
|
90 | +if (!$Admin->object_modify ("settings", "edit", "id", $values)) { $Result->show ("danger", _ ("Cannot update settings"), true); } |
|
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"> |
@@ -186,7 +186,10 @@ discard block |
||
186 | 186 | <tr> |
187 | 187 | <td class="title"><?php print _('API'); ?></td> |
188 | 188 | <td> |
189 | - <input type="checkbox" class="input-switch" value="1" name="api" <?php if($settings['api'] == 1) print 'checked'; ?>> |
|
189 | + <input type="checkbox" class="input-switch" value="1" name="api" <?php if($settings['api'] == 1) { |
|
190 | + print 'checked'; |
|
191 | +} |
|
192 | +?>> |
|
190 | 193 | </td> |
191 | 194 | <td class="info2"> |
192 | 195 | <?php print _('Enable or disable API server module'); ?> |
@@ -197,7 +200,10 @@ discard block |
||
197 | 200 | <tr> |
198 | 201 | <td class="title"><?php print _('IP request module'); ?></td> |
199 | 202 | <td> |
200 | - <input type="checkbox" class="input-switch" value="1" name="enableIPrequests" <?php if($settings['enableIPrequests'] == 1) print 'checked'; ?>> |
|
203 | + <input type="checkbox" class="input-switch" value="1" name="enableIPrequests" <?php if($settings['enableIPrequests'] == 1) { |
|
204 | + print 'checked'; |
|
205 | +} |
|
206 | +?>> |
|
201 | 207 | </td> |
202 | 208 | <td class="info2"> |
203 | 209 | <?php print _('Enable or disable IP request module'); ?> |
@@ -208,7 +214,10 @@ discard block |
||
208 | 214 | <tr> |
209 | 215 | <td class="title"><?php print _('Enable VRF support'); ?></td> |
210 | 216 | <td> |
211 | - <input type="checkbox" class="input-switch" value="1" name="enableVRF" <?php if($settings['enableVRF'] == 1) print 'checked'; ?>> |
|
217 | + <input type="checkbox" class="input-switch" value="1" name="enableVRF" <?php if($settings['enableVRF'] == 1) { |
|
218 | + print 'checked'; |
|
219 | +} |
|
220 | +?>> |
|
212 | 221 | </td> |
213 | 222 | <td class="info2"> |
214 | 223 | <?php print _('Enable or disable VRF module'); ?> |
@@ -219,7 +228,10 @@ discard block |
||
219 | 228 | <tr> |
220 | 229 | <td class="title"><?php print _('Enable PowerDNS'); ?></td> |
221 | 230 | <td> |
222 | - <input type="checkbox" class="input-switch" value="1" name="enablePowerDNS" <?php if($settings['enablePowerDNS'] == 1) print 'checked'; ?>> |
|
231 | + <input type="checkbox" class="input-switch" value="1" name="enablePowerDNS" <?php if($settings['enablePowerDNS'] == 1) { |
|
232 | + print 'checked'; |
|
233 | +} |
|
234 | +?>> |
|
223 | 235 | </td> |
224 | 236 | <td class="info2"> |
225 | 237 | <?php print _('Enable or disable PowerDNS module'); ?> |
@@ -230,7 +242,10 @@ discard block |
||
230 | 242 | <tr> |
231 | 243 | <td class="title"><?php print _('Enable Firewall Zones'); ?></td> |
232 | 244 | <td> |
233 | - <input type="checkbox" class="input-switch" value="1" name="enableFirewallZones" <?php if($settings['enableFirewallZones'] == 1) print 'checked'; ?>> |
|
245 | + <input type="checkbox" class="input-switch" value="1" name="enableFirewallZones" <?php if($settings['enableFirewallZones'] == 1) { |
|
246 | + print 'checked'; |
|
247 | +} |
|
248 | +?>> |
|
234 | 249 | </td> |
235 | 250 | <td class="info2"> |
236 | 251 | <?php print _('Enable or disable firewall zone management module'); ?> |
@@ -241,7 +256,10 @@ discard block |
||
241 | 256 | <tr> |
242 | 257 | <td class="title"><?php print _('Resolve DNS names'); ?></td> |
243 | 258 | <td> |
244 | - <input type="checkbox" value="1" class="input-switch" name="enableDNSresolving" <?php if($settings['enableDNSresolving'] == 1) print 'checked'; ?>> |
|
259 | + <input type="checkbox" value="1" class="input-switch" name="enableDNSresolving" <?php if($settings['enableDNSresolving'] == 1) { |
|
260 | + print 'checked'; |
|
261 | +} |
|
262 | +?>> |
|
245 | 263 | </td> |
246 | 264 | <td class="info2"> |
247 | 265 | <?php print _('Check reverse dns lookups for IP addresses that do not have hostname in database. (Activating this feature can significantly increase ip address pages loading time!)'); ?> |
@@ -252,7 +270,13 @@ discard block |
||
252 | 270 | <tr> |
253 | 271 | <td class="title"><?php print _('Temporary shares'); ?></td> |
254 | 272 | <td> |
255 | - <input type="checkbox" value="1" class="input-switch" name="tempShare" <?php if($settings['tempShare'] == 0) print ''; else print 'checked'; ?>> |
|
273 | + <input type="checkbox" value="1" class="input-switch" name="tempShare" <?php if($settings['tempShare'] == 0) { |
|
274 | + print ''; |
|
275 | +} |
|
276 | +else { |
|
277 | + print 'checked'; |
|
278 | +} |
|
279 | +?>> |
|
256 | 280 | </td> |
257 | 281 | <td class="info2"> |
258 | 282 | <?php print _('Allow temporary subnet sharing'); ?> |
@@ -263,7 +287,13 @@ discard block |
||
263 | 287 | <tr> |
264 | 288 | <td class="title"><?php print _('Changelog'); ?></td> |
265 | 289 | <td> |
266 | - <input type="checkbox" value="1" class="input-switch" name="enableChangelog" <?php if($settings['enableChangelog'] == 0) print ''; else print 'checked'; ?>> |
|
290 | + <input type="checkbox" value="1" class="input-switch" name="enableChangelog" <?php if($settings['enableChangelog'] == 0) { |
|
291 | + print ''; |
|
292 | +} |
|
293 | +else { |
|
294 | + print 'checked'; |
|
295 | +} |
|
296 | +?>> |
|
267 | 297 | </td> |
268 | 298 | <td class="info2"> |
269 | 299 | <?php print _('Enable changelog module'); ?> |
@@ -274,7 +304,10 @@ discard block |
||
274 | 304 | <tr> |
275 | 305 | <td class="title"><?php print _('Multicast module'); ?></td> |
276 | 306 | <td> |
277 | - <input type="checkbox" class="input-switch" value="1" name="enableMulticast" <?php if($settings['enableMulticast'] == 1) print 'checked'; ?>> |
|
307 | + <input type="checkbox" class="input-switch" value="1" name="enableMulticast" <?php if($settings['enableMulticast'] == 1) { |
|
308 | + print 'checked'; |
|
309 | +} |
|
310 | +?>> |
|
278 | 311 | </td> |
279 | 312 | <td class="info2"> |
280 | 313 | <?php print _('Enable or disable multicast module'); ?> |
@@ -285,7 +318,10 @@ discard block |
||
285 | 318 | <tr> |
286 | 319 | <td class="title"><?php print _('Threshold module'); ?></td> |
287 | 320 | <td> |
288 | - <input type="checkbox" class="input-switch" value="1" name="enableThreshold" <?php if($settings['enableThreshold'] == 1) print 'checked'; ?>> |
|
321 | + <input type="checkbox" class="input-switch" value="1" name="enableThreshold" <?php if($settings['enableThreshold'] == 1) { |
|
322 | + print 'checked'; |
|
323 | +} |
|
324 | +?>> |
|
289 | 325 | </td> |
290 | 326 | <td class="info2"> |
291 | 327 | <?php print _('Enable or disable threshold module'); ?> |
@@ -296,7 +332,10 @@ discard block |
||
296 | 332 | <tr> |
297 | 333 | <td class="title"><?php print _('Rack module'); ?></td> |
298 | 334 | <td> |
299 | - <input type="checkbox" class="input-switch" value="1" name="enableRACK" <?php if($settings['enableRACK'] == 1) print 'checked'; ?>> |
|
335 | + <input type="checkbox" class="input-switch" value="1" name="enableRACK" <?php if($settings['enableRACK'] == 1) { |
|
336 | + print 'checked'; |
|
337 | +} |
|
338 | +?>> |
|
300 | 339 | </td> |
301 | 340 | <td class="info2"> |
302 | 341 | <?php print _('Enable or disable rack drawing module'); ?> |
@@ -307,7 +346,10 @@ discard block |
||
307 | 346 | <tr> |
308 | 347 | <td class="title"><?php print _('SNMP module'); ?></td> |
309 | 348 | <td> |
310 | - <input type="checkbox" class="input-switch" value="1" name="enableSNMP" <?php if($settings['enableSNMP'] == 1) print 'checked'; ?>> |
|
349 | + <input type="checkbox" class="input-switch" value="1" name="enableSNMP" <?php if($settings['enableSNMP'] == 1) { |
|
350 | + print 'checked'; |
|
351 | +} |
|
352 | +?>> |
|
311 | 353 | </td> |
312 | 354 | <td class="info2"> |
313 | 355 | <?php print _('Enable or disable SNMP module for devices'); ?> |
@@ -428,7 +470,10 @@ discard block |
||
428 | 470 | <tr> |
429 | 471 | <td class="title"><?php print _('Hide donation button'); ?></td> |
430 | 472 | <td> |
431 | - <input type="checkbox" value="1" class="input-switch" name="donate" <?php if($settings['donate'] == 1) print 'checked'; ?>> |
|
473 | + <input type="checkbox" value="1" class="input-switch" name="donate" <?php if($settings['donate'] == 1) { |
|
474 | + print 'checked'; |
|
475 | +} |
|
476 | +?>> |
|
432 | 477 | </td> |
433 | 478 | <td class="info2"> |
434 | 479 | <?php print _('Hide donation button'); ?> |
@@ -5,13 +5,13 @@ discard block |
||
5 | 5 | **************************/ |
6 | 6 | |
7 | 7 | # verify that user is logged in |
8 | -$User->check_user_session(); |
|
8 | +$User->check_user_session (); |
|
9 | 9 | |
10 | 10 | # create csrf token |
11 | 11 | $csrf = $User->csrf_cookie ("create", "settings"); |
12 | 12 | |
13 | 13 | # fetch all languages |
14 | -$languages = $Admin->fetch_all_objects("lang", "l_id"); |
|
14 | +$languages = $Admin->fetch_all_objects ("lang", "l_id"); |
|
15 | 15 | |
16 | 16 | # set settings |
17 | 17 | $settings = (array) $User->settings; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | </script> |
31 | 31 | |
32 | 32 | <!-- title --> |
33 | -<h4><?php print _('phpIPAM Server settings'); ?></h4> |
|
33 | +<h4><?php print _ ('phpIPAM Server settings'); ?></h4> |
|
34 | 34 | <hr> |
35 | 35 | |
36 | 36 | <form name="settings" id="settings"> |
@@ -38,111 +38,111 @@ discard block |
||
38 | 38 | |
39 | 39 | <!-- site settings --> |
40 | 40 | <tr class="settings-title"> |
41 | - <th colspan="3"><h4><?php print _('Site settings'); ?></h4></th> |
|
41 | + <th colspan="3"><h4><?php print _ ('Site settings'); ?></h4></th> |
|
42 | 42 | </tr> |
43 | 43 | |
44 | 44 | <!-- site title --> |
45 | 45 | <tr> |
46 | - <td><?php print _('Site title'); ?></th> |
|
46 | + <td><?php print _ ('Site title'); ?></th> |
|
47 | 47 | <td> |
48 | 48 | <input type="text" class="form-control input-sm" name="siteTitle" value="<?php print $settings['siteTitle']; ?>"> |
49 | 49 | <input type="hidden" name="csrf_cookie" value="<?php print $csrf; ?>"> |
50 | 50 | </td> |
51 | - <td class="info2"><?php print _('Set site title'); ?></td> |
|
51 | + <td class="info2"><?php print _ ('Set site title'); ?></td> |
|
52 | 52 | </tr> |
53 | 53 | |
54 | 54 | <!-- site domain --> |
55 | 55 | <tr> |
56 | - <td><?php print _('Site domain'); ?></td> |
|
56 | + <td><?php print _ ('Site domain'); ?></td> |
|
57 | 57 | <td> |
58 | 58 | <input type="text" class="form-control input-sm" name="siteDomain" value="<?php print $settings['siteDomain']; ?>"> |
59 | 59 | </td> |
60 | - <td class="info2"><?php print _('Set domain for sending mail notifications'); ?></td> |
|
60 | + <td class="info2"><?php print _ ('Set domain for sending mail notifications'); ?></td> |
|
61 | 61 | </tr> |
62 | 62 | |
63 | 63 | <!-- site URL --> |
64 | 64 | <tr> |
65 | - <td class="title"><?php print _('Site URL'); ?></td> |
|
65 | + <td class="title"><?php print _ ('Site URL'); ?></td> |
|
66 | 66 | <td> |
67 | 67 | <input type="text" class="form-control input-sm" name="siteURL" value="<?php print $settings['siteURL']; ?>"> |
68 | 68 | </td> |
69 | - <td class="info2"><?php print _('Set site URL'); ?></td> |
|
69 | + <td class="info2"><?php print _ ('Set site URL'); ?></td> |
|
70 | 70 | </tr> |
71 | 71 | <!-- Login header text --> |
72 | 72 | <tr> |
73 | - <td class="title"><?php print _('Login text'); ?></td> |
|
73 | + <td class="title"><?php print _ ('Login text'); ?></td> |
|
74 | 74 | <td> |
75 | 75 | <input type="text" class="form-control input-sm" name="siteLoginText" value="<?php print $settings['siteLoginText']; ?>"> |
76 | 76 | </td> |
77 | - <td class="info2"><?php print _("Show text above 'username' field on login page (default empty)"); ?></td> |
|
77 | + <td class="info2"><?php print _ ("Show text above 'username' field on login page (default empty)"); ?></td> |
|
78 | 78 | </tr> |
79 | 79 | <!-- prettyLinks --> |
80 | 80 | <tr> |
81 | - <td class="title"><?php print _('Prettify links'); ?></td> |
|
81 | + <td class="title"><?php print _ ('Prettify links'); ?></td> |
|
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>"; } |
|
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 | 88 | ?> |
89 | 89 | </select> |
90 | 90 | </td> |
91 | 91 | <td class="info2"> |
92 | - <?php print _('Use nicer URL structure'); ?>?<br> |
|
92 | + <?php print _ ('Use nicer URL structure'); ?>?<br> |
|
93 | 93 | <ul> |
94 | - <li><?php print _("No"); ?>: ?page=administration&link2=settings</li> |
|
95 | - <li><?php print _("Yes"); ?>: /administration/settings/</li> |
|
94 | + <li><?php print _ ("No"); ?>: ?page=administration&link2=settings</li> |
|
95 | + <li><?php print _ ("Yes"); ?>: /administration/settings/</li> |
|
96 | 96 | </ul> |
97 | - <?php print _("Please note that mod_rewrite is required with appropriate settings if pretified links are selected."); ?><br> |
|
97 | + <?php print _ ("Please note that mod_rewrite is required with appropriate settings if pretified links are selected."); ?><br> |
|
98 | 98 | <a href="http://phpipam.net/prettified-links-with-mod_rewrite/">http://phpipam.net/prettified-links-with-mod_rewrite/</a> |
99 | 99 | </td> |
100 | 100 | </tr> |
101 | 101 | <!-- Default language --> |
102 | 102 | <tr> |
103 | - <td class="title"><?php print _('Default language'); ?></td> |
|
103 | + <td class="title"><?php print _ ('Default language'); ?></td> |
|
104 | 104 | <td> |
105 | 105 | <select name="defaultLang" class="form-control input-sm input-w-auto"> |
106 | 106 | <?php |
107 | - if(sizeof($languages)>0) { |
|
107 | + if (sizeof ($languages) > 0) { |
|
108 | 108 | //default |
109 | 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>"; } |
|
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 | 113 | } |
114 | 114 | } |
115 | 115 | ?> |
116 | 116 | </select> |
117 | 117 | </td> |
118 | - <td class="info2"><?php print _('Select default language'); ?></td> |
|
118 | + <td class="info2"><?php print _ ('Select default language'); ?></td> |
|
119 | 119 | </tr> |
120 | 120 | |
121 | 121 | <!-- Mex session duration --> |
122 | 122 | <tr> |
123 | - <td class="title"><?php print _('Inactivity timeout'); ?></td> |
|
123 | + <td class="title"><?php print _ ('Inactivity timeout'); ?></td> |
|
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"); |
|
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 | 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>"; } |
|
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 | 132 | } |
133 | 133 | ?> |
134 | 134 | </select> |
135 | 135 | </td> |
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> |
|
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> |
|
137 | 137 | </tr> |
138 | 138 | <!-- Max VLAN number --> |
139 | 139 | <tr> |
140 | - <td class="title"><?php print _('Highest VLAN number'); ?></td> |
|
140 | + <td class="title"><?php print _ ('Highest VLAN number'); ?></td> |
|
141 | 141 | <td> |
142 | 142 | <input type="text" class="form-control input-sm" name="vlanMax" value="<?php print $settings['vlanMax']; ?>"> |
143 | 143 | </td> |
144 | 144 | <td class="info2"> |
145 | - <?php print _('Set highest VLAN number (default 4096)'); ?> |
|
145 | + <?php print _ ('Set highest VLAN number (default 4096)'); ?> |
|
146 | 146 | </td> |
147 | 147 | </tr> |
148 | 148 | |
@@ -150,28 +150,28 @@ discard block |
||
150 | 150 | |
151 | 151 | <!-- Admin settings --> |
152 | 152 | <tr class="settings-title"> |
153 | - <th colspan="3"><h4><?php print _('Admin settings'); ?></h4></th> |
|
153 | + <th colspan="3"><h4><?php print _ ('Admin settings'); ?></h4></th> |
|
154 | 154 | </tr> |
155 | 155 | |
156 | 156 | <!-- Admin name --> |
157 | 157 | <tr> |
158 | - <td class="title"><?php print _('Admin name'); ?></td> |
|
158 | + <td class="title"><?php print _ ('Admin name'); ?></td> |
|
159 | 159 | <td> |
160 | 160 | <input type="text" class="form-control input-sm" name="siteAdminName" value="<?php print $settings['siteAdminName']; ?>"> |
161 | 161 | </td> |
162 | 162 | <td class="info2"> |
163 | - <?php print _('Set administrator name'); ?> |
|
163 | + <?php print _ ('Set administrator name'); ?> |
|
164 | 164 | </td> |
165 | 165 | </tr> |
166 | 166 | |
167 | 167 | <!-- Admin mail --> |
168 | 168 | <tr> |
169 | - <td class="title"><?php print _('Admin mail'); ?></td> |
|
169 | + <td class="title"><?php print _ ('Admin mail'); ?></td> |
|
170 | 170 | <td> |
171 | 171 | <input type="text" class="form-control input-sm" name="siteAdminMail" value="<?php print $settings['siteAdminMail']; ?>"> |
172 | 172 | </td> |
173 | 173 | <td class="info2"> |
174 | - <?php print _('Set administrator e-mail'); ?> |
|
174 | + <?php print _ ('Set administrator e-mail'); ?> |
|
175 | 175 | </td> |
176 | 176 | </tr> |
177 | 177 | |
@@ -179,159 +179,159 @@ discard block |
||
179 | 179 | |
180 | 180 | <!-- features --> |
181 | 181 | <tr class="settings-title"> |
182 | - <th colspan="3"><h4><?php print _('Feature settings'); ?></h4></th> |
|
182 | + <th colspan="3"><h4><?php print _ ('Feature settings'); ?></h4></th> |
|
183 | 183 | </tr> |
184 | 184 | |
185 | 185 | <!-- API --> |
186 | 186 | <tr> |
187 | - <td class="title"><?php print _('API'); ?></td> |
|
187 | + <td class="title"><?php print _ ('API'); ?></td> |
|
188 | 188 | <td> |
189 | - <input type="checkbox" class="input-switch" value="1" name="api" <?php if($settings['api'] == 1) print 'checked'; ?>> |
|
189 | + <input type="checkbox" class="input-switch" value="1" name="api" <?php if ($settings['api'] == 1) print 'checked'; ?>> |
|
190 | 190 | </td> |
191 | 191 | <td class="info2"> |
192 | - <?php print _('Enable or disable API server module'); ?> |
|
192 | + <?php print _ ('Enable or disable API server module'); ?> |
|
193 | 193 | </td> |
194 | 194 | </tr> |
195 | 195 | |
196 | 196 | <!-- IP requests --> |
197 | 197 | <tr> |
198 | - <td class="title"><?php print _('IP request module'); ?></td> |
|
198 | + <td class="title"><?php print _ ('IP request module'); ?></td> |
|
199 | 199 | <td> |
200 | - <input type="checkbox" class="input-switch" value="1" name="enableIPrequests" <?php if($settings['enableIPrequests'] == 1) print 'checked'; ?>> |
|
200 | + <input type="checkbox" class="input-switch" value="1" name="enableIPrequests" <?php if ($settings['enableIPrequests'] == 1) print 'checked'; ?>> |
|
201 | 201 | </td> |
202 | 202 | <td class="info2"> |
203 | - <?php print _('Enable or disable IP request module'); ?> |
|
203 | + <?php print _ ('Enable or disable IP request module'); ?> |
|
204 | 204 | </td> |
205 | 205 | </tr> |
206 | 206 | |
207 | 207 | <!-- VRF --> |
208 | 208 | <tr> |
209 | - <td class="title"><?php print _('Enable VRF support'); ?></td> |
|
209 | + <td class="title"><?php print _ ('Enable VRF support'); ?></td> |
|
210 | 210 | <td> |
211 | - <input type="checkbox" class="input-switch" value="1" name="enableVRF" <?php if($settings['enableVRF'] == 1) print 'checked'; ?>> |
|
211 | + <input type="checkbox" class="input-switch" value="1" name="enableVRF" <?php if ($settings['enableVRF'] == 1) print 'checked'; ?>> |
|
212 | 212 | </td> |
213 | 213 | <td class="info2"> |
214 | - <?php print _('Enable or disable VRF module'); ?> |
|
214 | + <?php print _ ('Enable or disable VRF module'); ?> |
|
215 | 215 | </td> |
216 | 216 | </tr> |
217 | 217 | |
218 | 218 | <!-- powerdns --> |
219 | 219 | <tr> |
220 | - <td class="title"><?php print _('Enable PowerDNS'); ?></td> |
|
220 | + <td class="title"><?php print _ ('Enable PowerDNS'); ?></td> |
|
221 | 221 | <td> |
222 | - <input type="checkbox" class="input-switch" value="1" name="enablePowerDNS" <?php if($settings['enablePowerDNS'] == 1) print 'checked'; ?>> |
|
222 | + <input type="checkbox" class="input-switch" value="1" name="enablePowerDNS" <?php if ($settings['enablePowerDNS'] == 1) print 'checked'; ?>> |
|
223 | 223 | </td> |
224 | 224 | <td class="info2"> |
225 | - <?php print _('Enable or disable PowerDNS module'); ?> |
|
225 | + <?php print _ ('Enable or disable PowerDNS module'); ?> |
|
226 | 226 | </td> |
227 | 227 | </tr> |
228 | 228 | |
229 | 229 | <!-- firewall zone management --> |
230 | 230 | <tr> |
231 | - <td class="title"><?php print _('Enable Firewall Zones'); ?></td> |
|
231 | + <td class="title"><?php print _ ('Enable Firewall Zones'); ?></td> |
|
232 | 232 | <td> |
233 | - <input type="checkbox" class="input-switch" value="1" name="enableFirewallZones" <?php if($settings['enableFirewallZones'] == 1) print 'checked'; ?>> |
|
233 | + <input type="checkbox" class="input-switch" value="1" name="enableFirewallZones" <?php if ($settings['enableFirewallZones'] == 1) print 'checked'; ?>> |
|
234 | 234 | </td> |
235 | 235 | <td class="info2"> |
236 | - <?php print _('Enable or disable firewall zone management module'); ?> |
|
236 | + <?php print _ ('Enable or disable firewall zone management module'); ?> |
|
237 | 237 | </td> |
238 | 238 | </tr> |
239 | 239 | |
240 | 240 | <!-- DNS resolving --> |
241 | 241 | <tr> |
242 | - <td class="title"><?php print _('Resolve DNS names'); ?></td> |
|
242 | + <td class="title"><?php print _ ('Resolve DNS names'); ?></td> |
|
243 | 243 | <td> |
244 | - <input type="checkbox" value="1" class="input-switch" name="enableDNSresolving" <?php if($settings['enableDNSresolving'] == 1) print 'checked'; ?>> |
|
244 | + <input type="checkbox" value="1" class="input-switch" name="enableDNSresolving" <?php if ($settings['enableDNSresolving'] == 1) print 'checked'; ?>> |
|
245 | 245 | </td> |
246 | 246 | <td class="info2"> |
247 | - <?php print _('Check reverse dns lookups for IP addresses that do not have hostname in database. (Activating this feature can significantly increase ip address pages loading time!)'); ?> |
|
247 | + <?php print _ ('Check reverse dns lookups for IP addresses that do not have hostname in database. (Activating this feature can significantly increase ip address pages loading time!)'); ?> |
|
248 | 248 | </td> |
249 | 249 | </tr> |
250 | 250 | |
251 | 251 | <!-- Share --> |
252 | 252 | <tr> |
253 | - <td class="title"><?php print _('Temporary shares'); ?></td> |
|
253 | + <td class="title"><?php print _ ('Temporary shares'); ?></td> |
|
254 | 254 | <td> |
255 | - <input type="checkbox" value="1" class="input-switch" name="tempShare" <?php if($settings['tempShare'] == 0) print ''; else print 'checked'; ?>> |
|
255 | + <input type="checkbox" value="1" class="input-switch" name="tempShare" <?php if ($settings['tempShare'] == 0) print ''; else print 'checked'; ?>> |
|
256 | 256 | </td> |
257 | 257 | <td class="info2"> |
258 | - <?php print _('Allow temporary subnet sharing'); ?> |
|
258 | + <?php print _ ('Allow temporary subnet sharing'); ?> |
|
259 | 259 | </td> |
260 | 260 | </tr> |
261 | 261 | |
262 | 262 | <!-- changelog --> |
263 | 263 | <tr> |
264 | - <td class="title"><?php print _('Changelog'); ?></td> |
|
264 | + <td class="title"><?php print _ ('Changelog'); ?></td> |
|
265 | 265 | <td> |
266 | - <input type="checkbox" value="1" class="input-switch" name="enableChangelog" <?php if($settings['enableChangelog'] == 0) print ''; else print 'checked'; ?>> |
|
266 | + <input type="checkbox" value="1" class="input-switch" name="enableChangelog" <?php if ($settings['enableChangelog'] == 0) print ''; else print 'checked'; ?>> |
|
267 | 267 | </td> |
268 | 268 | <td class="info2"> |
269 | - <?php print _('Enable changelog module'); ?> |
|
269 | + <?php print _ ('Enable changelog module'); ?> |
|
270 | 270 | </td> |
271 | 271 | </tr> |
272 | 272 | |
273 | 273 | <!-- Multicast --> |
274 | 274 | <tr> |
275 | - <td class="title"><?php print _('Multicast module'); ?></td> |
|
275 | + <td class="title"><?php print _ ('Multicast module'); ?></td> |
|
276 | 276 | <td> |
277 | - <input type="checkbox" class="input-switch" value="1" name="enableMulticast" <?php if($settings['enableMulticast'] == 1) print 'checked'; ?>> |
|
277 | + <input type="checkbox" class="input-switch" value="1" name="enableMulticast" <?php if ($settings['enableMulticast'] == 1) print 'checked'; ?>> |
|
278 | 278 | </td> |
279 | 279 | <td class="info2"> |
280 | - <?php print _('Enable or disable multicast module'); ?> |
|
280 | + <?php print _ ('Enable or disable multicast module'); ?> |
|
281 | 281 | </td> |
282 | 282 | </tr> |
283 | 283 | |
284 | 284 | <!-- threshold --> |
285 | 285 | <tr> |
286 | - <td class="title"><?php print _('Threshold module'); ?></td> |
|
286 | + <td class="title"><?php print _ ('Threshold module'); ?></td> |
|
287 | 287 | <td> |
288 | - <input type="checkbox" class="input-switch" value="1" name="enableThreshold" <?php if($settings['enableThreshold'] == 1) print 'checked'; ?>> |
|
288 | + <input type="checkbox" class="input-switch" value="1" name="enableThreshold" <?php if ($settings['enableThreshold'] == 1) print 'checked'; ?>> |
|
289 | 289 | </td> |
290 | 290 | <td class="info2"> |
291 | - <?php print _('Enable or disable threshold module'); ?> |
|
291 | + <?php print _ ('Enable or disable threshold module'); ?> |
|
292 | 292 | </td> |
293 | 293 | </tr> |
294 | 294 | |
295 | 295 | <!-- Rack --> |
296 | 296 | <tr> |
297 | - <td class="title"><?php print _('Rack module'); ?></td> |
|
297 | + <td class="title"><?php print _ ('Rack module'); ?></td> |
|
298 | 298 | <td> |
299 | - <input type="checkbox" class="input-switch" value="1" name="enableRACK" <?php if($settings['enableRACK'] == 1) print 'checked'; ?>> |
|
299 | + <input type="checkbox" class="input-switch" value="1" name="enableRACK" <?php if ($settings['enableRACK'] == 1) print 'checked'; ?>> |
|
300 | 300 | </td> |
301 | 301 | <td class="info2"> |
302 | - <?php print _('Enable or disable rack drawing module'); ?> |
|
302 | + <?php print _ ('Enable or disable rack drawing module'); ?> |
|
303 | 303 | </td> |
304 | 304 | </tr> |
305 | 305 | |
306 | 306 | <!-- Rack --> |
307 | 307 | <tr> |
308 | - <td class="title"><?php print _('SNMP module'); ?></td> |
|
308 | + <td class="title"><?php print _ ('SNMP module'); ?></td> |
|
309 | 309 | <td> |
310 | - <input type="checkbox" class="input-switch" value="1" name="enableSNMP" <?php if($settings['enableSNMP'] == 1) print 'checked'; ?>> |
|
310 | + <input type="checkbox" class="input-switch" value="1" name="enableSNMP" <?php if ($settings['enableSNMP'] == 1) print 'checked'; ?>> |
|
311 | 311 | </td> |
312 | 312 | <td class="info2"> |
313 | - <?php print _('Enable or disable SNMP module for devices'); ?> |
|
313 | + <?php print _ ('Enable or disable SNMP module for devices'); ?> |
|
314 | 314 | </td> |
315 | 315 | </tr> |
316 | 316 | |
317 | 317 | <!-- Log location --> |
318 | 318 | <tr> |
319 | - <td class="title"><?php print _('Syslog'); ?></td> |
|
319 | + <td class="title"><?php print _ ('Syslog'); ?></td> |
|
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"); |
|
323 | + $types = array ("Database"=>"Database", "syslog"=>"Syslog", "both"=>"Syslog and local Database"); |
|
324 | 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>"; } |
|
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 | 328 | } |
329 | 329 | ?> |
330 | 330 | </select> |
331 | 331 | |
332 | 332 | </td> |
333 | 333 | <td class="info2"> |
334 | - <?php print _('Set where to send system logs'); ?> |
|
334 | + <?php print _ ('Set where to send system logs'); ?> |
|
335 | 335 | </td> |
336 | 336 | </tr> |
337 | 337 | |
@@ -339,79 +339,79 @@ discard block |
||
339 | 339 | |
340 | 340 | <!-- ICPM --> |
341 | 341 | <tr class="settings-title"> |
342 | - <th colspan="3"><h4><?php print _('ICMP settings'); ?></h4></th> |
|
342 | + <th colspan="3"><h4><?php print _ ('ICMP settings'); ?></h4></th> |
|
343 | 343 | </tr> |
344 | 344 | |
345 | 345 | <!-- Scan type --> |
346 | 346 | <tr> |
347 | - <td class="title"><?php print _('Scan type'); ?></td> |
|
347 | + <td class="title"><?php print _ ('Scan type'); ?></td> |
|
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"); |
|
351 | + $types = array ("ping"=>"ping", "pear"=>"pear ping", "fping"=>"fping"); |
|
352 | 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>"; } |
|
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 | 356 | } |
357 | 357 | ?> |
358 | 358 | </select> |
359 | 359 | </td> |
360 | - <td class="info2"><?php print _('Select which utility to use for status checks.'); ?></td> |
|
360 | + <td class="info2"><?php print _ ('Select which utility to use for status checks.'); ?></td> |
|
361 | 361 | </tr> |
362 | 362 | |
363 | 363 | |
364 | 364 | <!-- Ping path --> |
365 | 365 | <tr> |
366 | - <td class="title"><?php print _('Ping path'); ?></td> |
|
366 | + <td class="title"><?php print _ ('Ping path'); ?></td> |
|
367 | 367 | <?php |
368 | 368 | //verify that ping file exists! |
369 | - if(!file_exists($settings['scanPingPath'])&&$settings['scanFPingType']=="ping") { $class="danger"; } |
|
370 | - else { $class=""; } |
|
369 | + if (!file_exists ($settings['scanPingPath']) && $settings['scanFPingType'] == "ping") { $class = "danger"; } |
|
370 | + else { $class = ""; } |
|
371 | 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> |
375 | 375 | <td class="info2"> |
376 | - <?php print _('Set path for ping executable file (default /bin/ping)'); ?> |
|
376 | + <?php print _ ('Set path for ping executable file (default /bin/ping)'); ?> |
|
377 | 377 | </td> |
378 | 378 | </tr> |
379 | 379 | |
380 | 380 | <!-- fping path --> |
381 | 381 | <tr> |
382 | - <td class="title"><?php print _('FPing path'); ?></td> |
|
382 | + <td class="title"><?php print _ ('FPing path'); ?></td> |
|
383 | 383 | <?php |
384 | 384 | //verify that ping file exists! |
385 | - if(!file_exists($settings['scanFPingPath'])&&$settings['scanFPingType']=="fping") { $class="danger"; } |
|
386 | - else { $class=""; } |
|
385 | + if (!file_exists ($settings['scanFPingPath']) && $settings['scanFPingType'] == "fping") { $class = "danger"; } |
|
386 | + else { $class = ""; } |
|
387 | 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> |
391 | 391 | <td class="info2"> |
392 | - <?php print _('Set path for fping executable file (default /bin/fping)'); ?> |
|
392 | + <?php print _ ('Set path for fping executable file (default /bin/fping)'); ?> |
|
393 | 393 | </td> |
394 | 394 | </tr> |
395 | 395 | |
396 | 396 | <!-- Ping status intervals --> |
397 | 397 | <tr> |
398 | - <td class="title"><?php print _('Ping status intervals'); ?></td> |
|
398 | + <td class="title"><?php print _ ('Ping status intervals'); ?></td> |
|
399 | 399 | <td> |
400 | 400 | <input type="text" class="form-control input-sm" name="pingStatus" value="<?php print $settings['pingStatus']; ?>"> |
401 | 401 | </td> |
402 | 402 | <td class="info2"> |
403 | - <?php print _('Ping status intervals for IP addresses in seconds - warning;offline (Default: 1800;3600)'); ?> |
|
403 | + <?php print _ ('Ping status intervals for IP addresses in seconds - warning;offline (Default: 1800;3600)'); ?> |
|
404 | 404 | </td> |
405 | 405 | </tr> |
406 | 406 | |
407 | 407 | <!-- Ping threads --> |
408 | 408 | <tr> |
409 | - <td class="title"><?php print _('Max scan threads'); ?></td> |
|
409 | + <td class="title"><?php print _ ('Max scan threads'); ?></td> |
|
410 | 410 | <td> |
411 | 411 | <input type="text" class="form-control input-sm" name="scanMaxThreads" value="<?php print $settings['scanMaxThreads']; ?>"> |
412 | 412 | </td> |
413 | 413 | <td class="info2"> |
414 | - <?php print _('Set maximum number of concurrent ICMP checks (default 128)'); ?> |
|
414 | + <?php print _ ('Set maximum number of concurrent ICMP checks (default 128)'); ?> |
|
415 | 415 | </td> |
416 | 416 | </tr> |
417 | 417 | |
@@ -421,28 +421,28 @@ discard block |
||
421 | 421 | |
422 | 422 | <!-- Display --> |
423 | 423 | <tr class="settings-title"> |
424 | - <th colspan="3"><h4><?php print _('Display settings'); ?></h4></th> |
|
424 | + <th colspan="3"><h4><?php print _ ('Display settings'); ?></h4></th> |
|
425 | 425 | </tr> |
426 | 426 | |
427 | 427 | <!-- Disable donation field --> |
428 | 428 | <tr> |
429 | - <td class="title"><?php print _('Hide donation button'); ?></td> |
|
429 | + <td class="title"><?php print _ ('Hide donation button'); ?></td> |
|
430 | 430 | <td> |
431 | - <input type="checkbox" value="1" class="input-switch" name="donate" <?php if($settings['donate'] == 1) print 'checked'; ?>> |
|
431 | + <input type="checkbox" value="1" class="input-switch" name="donate" <?php if ($settings['donate'] == 1) print 'checked'; ?>> |
|
432 | 432 | </td> |
433 | 433 | <td class="info2"> |
434 | - <?php print _('Hide donation button'); ?> |
|
434 | + <?php print _ ('Hide donation button'); ?> |
|
435 | 435 | </td> |
436 | 436 | </tr> |
437 | 437 | |
438 | 438 | <!-- Visual display limit --> |
439 | 439 | <tr> |
440 | - <td class="title"><?php print _('IP visual display limit'); ?></td> |
|
440 | + <td class="title"><?php print _ ('IP visual display limit'); ?></td> |
|
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"), |
|
444 | + $opts = array ( |
|
445 | + "0"=>_ ("Don't show visual display"), |
|
446 | 446 | "19"=>"/19 (8190)", |
447 | 447 | "20"=>"/20 (4094)", |
448 | 448 | "21"=>"/21 (2046)", |
@@ -451,65 +451,65 @@ discard block |
||
451 | 451 | "24"=>"/24 (256)" |
452 | 452 | ); |
453 | 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>"; } |
|
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 | 457 | } |
458 | 458 | |
459 | 459 | ?> |
460 | 460 | </select> |
461 | 461 | </td> |
462 | 462 | <td class="info2"> |
463 | - <?php print _('Select netmask limit for visual display of IP addresses (mask equal or bigger than - more then /22 not recommended)'); ?> |
|
463 | + <?php print _ ('Select netmask limit for visual display of IP addresses (mask equal or bigger than - more then /22 not recommended)'); ?> |
|
464 | 464 | </td> |
465 | 465 | </tr> |
466 | 466 | |
467 | 467 | <!-- Subnet ordering --> |
468 | 468 | <tr> |
469 | - <td class="title"><?php print _('Subnet ordering'); ?></td> |
|
469 | + <td class="title"><?php print _ ('Subnet ordering'); ?></td> |
|
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"), |
|
473 | + $opts = array ( |
|
474 | + "subnet,asc" => _ ("Subnet, ascending"), |
|
475 | + "subnet,desc" => _ ("Subnet, descending"), |
|
476 | + "description,asc" => _ ("Description, ascending"), |
|
477 | + "description,desc" => _ ("Description, descending"), |
|
478 | 478 | ); |
479 | 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>"; } |
|
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 | 483 | } |
484 | 484 | |
485 | 485 | ?> |
486 | 486 | </select> |
487 | 487 | </td> |
488 | 488 | <td class="info2"> |
489 | - <?php print _('How to order display of subnets'); ?> |
|
489 | + <?php print _ ('How to order display of subnets'); ?> |
|
490 | 490 | </td> |
491 | 491 | </tr> |
492 | 492 | |
493 | 493 | <!-- Subnet View --> |
494 | 494 | <tr> |
495 | - <td class="title"><?php print _('Subnet Display'); ?></td> |
|
495 | + <td class="title"><?php print _ ('Subnet Display'); ?></td> |
|
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"), |
|
499 | + $opts = array ( |
|
500 | + "0"=>_ ("Subnet Network Only"), |
|
501 | 501 | "1"=>"Description Only", |
502 | 502 | "2"=>"Subnet Network and Description" |
503 | 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>"; } |
|
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 | 507 | } |
508 | 508 | ?> |
509 | 509 | </select> |
510 | 510 | </td> |
511 | 511 | <td class="info2"> |
512 | - <?php print _('Select which view you would prefer on the menu'); ?> |
|
512 | + <?php print _ ('Select which view you would prefer on the menu'); ?> |
|
513 | 513 | </td> |
514 | 514 | </tr> |
515 | 515 | |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | <tr class="th"> |
527 | 527 | <td class="title"></td> |
528 | 528 | <td class="submit"> |
529 | - <input type="submit" class="btn btn-sm btn-success pull-right" value="<?php print _('Save changes'); ?>"> |
|
529 | + <input type="submit" class="btn btn-sm btn-success pull-right" value="<?php print _ ('Save changes'); ?>"> |
|
530 | 530 | </td> |
531 | 531 | <td></td> |
532 | 532 | </tr> |