@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | |
31 | 31 | if ($server->type == "LDAP") { |
32 | 32 | |
33 | - // Just discovered that adLDAP flat out won't work for normal ldap groups. Stop LDAP here. |
|
34 | - $Result->show("danger", _("Only AD group search is supported right now. Sorry."), true); |
|
35 | - return; |
|
33 | + // Just discovered that adLDAP flat out won't work for normal ldap groups. Stop LDAP here. |
|
34 | + $Result->show("danger", _("Only AD group search is supported right now. Sorry."), true); |
|
35 | + return; |
|
36 | 36 | |
37 | 37 | } |
38 | 38 | |
@@ -44,87 +44,87 @@ discard block |
||
44 | 44 | |
45 | 45 | //open connection |
46 | 46 | try { |
47 | - if($server->type == "NetIQ" || $server->type == "LDAP") { $params->account_suffix = ""; } |
|
48 | - //set options |
|
49 | - $options = array( |
|
50 | - 'base_dn'=>$params->base_dn, |
|
51 | - 'account_suffix'=>$params->account_suffix, |
|
52 | - 'domain_controllers'=>explode(";",$params->domain_controllers), |
|
53 | - 'use_ssl'=>$params->use_ssl, |
|
54 | - 'use_tls'=>$params->use_tls, |
|
55 | - 'ad_port'=>$params->ad_port |
|
56 | - ); |
|
57 | - //AD |
|
58 | - $adldap = new adLDAP($options); |
|
59 | - |
|
60 | - // Use credentials if they've been provided |
|
61 | - if (isset($params->adminUsername) && isset($params->adminPassword)) { |
|
62 | - $authUser = $adldap->authenticate($params->adminUsername, $params->adminPassword); |
|
63 | - if ($authUser == false) { |
|
64 | - $Result->show("danger", _("Invalid credentials"), true); |
|
65 | - } |
|
66 | - } |
|
67 | - |
|
68 | - //search groups |
|
69 | - $groups = $adldap->group()->search(adLDAP::ADLDAP_SECURITY_GLOBAL_GROUP,true,"*$_POST[dfilter]*"); |
|
70 | - |
|
71 | - //echo $adldap->getLastError(); |
|
47 | + if($server->type == "NetIQ" || $server->type == "LDAP") { $params->account_suffix = ""; } |
|
48 | + //set options |
|
49 | + $options = array( |
|
50 | + 'base_dn'=>$params->base_dn, |
|
51 | + 'account_suffix'=>$params->account_suffix, |
|
52 | + 'domain_controllers'=>explode(";",$params->domain_controllers), |
|
53 | + 'use_ssl'=>$params->use_ssl, |
|
54 | + 'use_tls'=>$params->use_tls, |
|
55 | + 'ad_port'=>$params->ad_port |
|
56 | + ); |
|
57 | + //AD |
|
58 | + $adldap = new adLDAP($options); |
|
59 | + |
|
60 | + // Use credentials if they've been provided |
|
61 | + if (isset($params->adminUsername) && isset($params->adminPassword)) { |
|
62 | + $authUser = $adldap->authenticate($params->adminUsername, $params->adminPassword); |
|
63 | + if ($authUser == false) { |
|
64 | + $Result->show("danger", _("Invalid credentials"), true); |
|
65 | + } |
|
66 | + } |
|
67 | + |
|
68 | + //search groups |
|
69 | + $groups = $adldap->group()->search(adLDAP::ADLDAP_SECURITY_GLOBAL_GROUP,true,"*$_POST[dfilter]*"); |
|
70 | + |
|
71 | + //echo $adldap->getLastError(); |
|
72 | 72 | } |
73 | 73 | catch (adLDAPException $e) { |
74 | - $Result->show("danger", $adldap->getLastError(), false); |
|
75 | - $Result->show("danger", $e->getMessage(), true); |
|
74 | + $Result->show("danger", $adldap->getLastError(), false); |
|
75 | + $Result->show("danger", $e->getMessage(), true); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | |
79 | 79 | //check for found |
80 | 80 | if(sizeof($groups)==0) { |
81 | - print "<div class='alert alert-info'>"; |
|
82 | - print _('No groups found')."!<hr>"; |
|
83 | - print _('Possible reasons').":"; |
|
84 | - print "<ul>"; |
|
85 | - print "<li>"._('Invalid baseDN setting for ' . $server->type)."</li>"; |
|
86 | - print "<li>"._($server->type . ' account does not have enough privileges for search')."</li>"; |
|
87 | - print "</div>"; |
|
81 | + print "<div class='alert alert-info'>"; |
|
82 | + print _('No groups found')."!<hr>"; |
|
83 | + print _('Possible reasons').":"; |
|
84 | + print "<ul>"; |
|
85 | + print "<li>"._('Invalid baseDN setting for ' . $server->type)."</li>"; |
|
86 | + print "<li>"._($server->type . ' account does not have enough privileges for search')."</li>"; |
|
87 | + print "</div>"; |
|
88 | 88 | } else { |
89 | - print _(" Following groups were found").": (".sizeof($groups)."):<hr>"; |
|
90 | - |
|
91 | - print "<table class='table table-top table-td-top table-striped'>"; |
|
92 | - |
|
93 | - // loop |
|
94 | - foreach($groups as $k=>$g) { |
|
95 | - print "<tr>"; |
|
96 | - print " <td>$k</td>"; |
|
97 | - print " <td>$g</td>"; |
|
98 | - //actions |
|
99 | - print " <td style='width:10px;'>"; |
|
100 | - print " <a href='' class='btn btn-sm btn-default btn-success groupselect' data-gname='$k' data-gdescription='$g' data-members='$members' data-gid='$k' data-csrf_cookie='$csrf'>"._('Add group')."</a>"; |
|
101 | - print " </td>"; |
|
102 | - print "</tr>"; |
|
103 | - |
|
104 | - print "<tr>"; |
|
105 | - print " <td>"._("Members:")."</td>"; |
|
106 | - print "<td colspan='2'>"; |
|
107 | - print " <div class='adgroup-$k'></div>"; |
|
108 | - // search members |
|
109 | - $groupMembers = $adldap->group()->members($k); |
|
110 | - unset($members); |
|
111 | - if($groupMembers!==false) { |
|
112 | - foreach($groupMembers as $m) { |
|
113 | - print "<span class='muted'>$m</span><br>"; |
|
114 | - $members[] = $m; |
|
115 | - } |
|
116 | - if(isset($members)) |
|
117 | - $members = implode(";", $members); |
|
118 | - } |
|
119 | - else { |
|
120 | - $members = ""; |
|
121 | - print "<span class='muted'>"._("No members")."</span>"; |
|
122 | - } |
|
123 | - print " </td>"; |
|
124 | - print " </tr>"; |
|
125 | - |
|
126 | - } |
|
127 | - print "</table>"; |
|
89 | + print _(" Following groups were found").": (".sizeof($groups)."):<hr>"; |
|
90 | + |
|
91 | + print "<table class='table table-top table-td-top table-striped'>"; |
|
92 | + |
|
93 | + // loop |
|
94 | + foreach($groups as $k=>$g) { |
|
95 | + print "<tr>"; |
|
96 | + print " <td>$k</td>"; |
|
97 | + print " <td>$g</td>"; |
|
98 | + //actions |
|
99 | + print " <td style='width:10px;'>"; |
|
100 | + print " <a href='' class='btn btn-sm btn-default btn-success groupselect' data-gname='$k' data-gdescription='$g' data-members='$members' data-gid='$k' data-csrf_cookie='$csrf'>"._('Add group')."</a>"; |
|
101 | + print " </td>"; |
|
102 | + print "</tr>"; |
|
103 | + |
|
104 | + print "<tr>"; |
|
105 | + print " <td>"._("Members:")."</td>"; |
|
106 | + print "<td colspan='2'>"; |
|
107 | + print " <div class='adgroup-$k'></div>"; |
|
108 | + // search members |
|
109 | + $groupMembers = $adldap->group()->members($k); |
|
110 | + unset($members); |
|
111 | + if($groupMembers!==false) { |
|
112 | + foreach($groupMembers as $m) { |
|
113 | + print "<span class='muted'>$m</span><br>"; |
|
114 | + $members[] = $m; |
|
115 | + } |
|
116 | + if(isset($members)) |
|
117 | + $members = implode(";", $members); |
|
118 | + } |
|
119 | + else { |
|
120 | + $members = ""; |
|
121 | + print "<span class='muted'>"._("No members")."</span>"; |
|
122 | + } |
|
123 | + print " </td>"; |
|
124 | + print " </tr>"; |
|
125 | + |
|
126 | + } |
|
127 | + print "</table>"; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | ?> |
131 | 131 | \ No newline at end of file |
@@ -16,15 +16,15 @@ discard block |
||
16 | 16 | # fetch all auth methods |
17 | 17 | $auth_methods = $Admin->fetch_all_objects ("usersAuthMethod"); |
18 | 18 | if ($auth_methods!==false) { |
19 | - foreach ($auth_methods as $k=>$m) { |
|
20 | - if (!($m->type=="AD" || $m->type=="LDAP")) { |
|
21 | - unset($auth_methods[$k]); |
|
22 | - } |
|
23 | - } |
|
24 | - // none |
|
25 | - if (sizeof($auth_methods)==0) { |
|
26 | - $auth_methods = false; |
|
27 | - } |
|
19 | + foreach ($auth_methods as $k=>$m) { |
|
20 | + if (!($m->type=="AD" || $m->type=="LDAP")) { |
|
21 | + unset($auth_methods[$k]); |
|
22 | + } |
|
23 | + } |
|
24 | + // none |
|
25 | + if (sizeof($auth_methods)==0) { |
|
26 | + $auth_methods = false; |
|
27 | + } |
|
28 | 28 | } |
29 | 29 | ?> |
30 | 30 | |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | <td><?php print _('Administrator level users'); ?></td> |
63 | 63 | <td> |
64 | 64 | <?php |
65 | - foreach($admins as $a) { |
|
66 | - print $a->real_name."<br>"; |
|
67 | - } |
|
68 | - ?> |
|
65 | + foreach($admins as $a) { |
|
66 | + print $a->real_name."<br>"; |
|
67 | + } |
|
68 | + ?> |
|
69 | 69 | </td> |
70 | 70 | <td><?php print _('All sections :'); ?> <span class="badge badge1 badge5">Read / Write</span></td> |
71 | 71 | <td colspan="2"></td> |
@@ -74,58 +74,58 @@ discard block |
||
74 | 74 | <?php |
75 | 75 | /* print existing sections */ |
76 | 76 | if($groups) { |
77 | - foreach ($groups as $g) { |
|
78 | - //cast |
|
79 | - $g = (array) $g; |
|
80 | - |
|
81 | - print '<tr>' . "\n"; |
|
82 | - print ' <td><strong>' . $g['g_name'] . '</strong></td>'. "\n"; |
|
83 | - print ' <td>' . $g['g_desc'] . '</td>'. "\n"; |
|
84 | - # users in group |
|
85 | - print " <td>"; |
|
86 | - $u = $Admin->group_fetch_users($g['g_id']); |
|
87 | - if(sizeof($u)>0) { |
|
88 | - foreach($u as $name) { |
|
89 | - # get details |
|
90 | - $user = $Admin->fetch_object("users", "id", $name); |
|
91 | - print $user->real_name."<br>"; |
|
92 | - } |
|
93 | - } else { |
|
94 | - print "<span class='text-muted'>"._("No users")."</span>"; |
|
95 | - } |
|
96 | - print "</td>"; |
|
97 | - |
|
98 | - # section permissions |
|
99 | - print " <td>"; |
|
100 | - $permissions = $Sections->get_group_section_permissions ($g['g_id']); |
|
101 | - if(sizeof($permissions)>0) { |
|
102 | - foreach($permissions as $sec=>$perm) { |
|
103 | - # reformat permissions |
|
104 | - $perm = $Subnets->parse_permissions($perm); |
|
105 | - print $sec." : <span class='badge badge1 badge5'>".$perm."</span><br>"; |
|
106 | - } |
|
107 | - } |
|
108 | - print "</td>"; |
|
109 | - |
|
110 | - |
|
111 | - # add/remove users |
|
112 | - print " <td class='actions'>"; |
|
113 | - print " <div class='btn-group'>"; |
|
114 | - print " <button class='btn btn-xs btn-default addToGroup' data-groupid='$g[g_id]' data-action='add' rel='tooltip' data-container='body' title='"._('add users to this group')."'> <i class='fa fa-plus'></i></button>"; |
|
115 | - print " <button class='btn btn-xs btn-default removeFromGroup' data-groupid='$g[g_id]' data-action='remove' rel='tooltip' data-container='body' title='"._('remove users from this group')."'><i class='fa fa-minus'></i></button>"; |
|
116 | - print " </div>"; |
|
117 | - print "</td>"; |
|
118 | - |
|
119 | - # edit, delete |
|
120 | - print "<td class='actions'>"; |
|
121 | - print " <div class='btn-group'>"; |
|
122 | - print " <button class='btn btn-xs btn-default editGroup' data-groupid='$g[g_id]' data-action='edit' rel='tooltip' data-container='body' title='"._('edit group details')."'> <i class='fa fa-pencil'></i></button>"; |
|
123 | - print " <button class='btn btn-xs btn-default editGroup' data-groupid='$g[g_id]' data-action='delete' rel='tooltip' data-container='body' title='"._('remove group')."'> <i class='fa fa-times'></i></button>"; |
|
124 | - print " </div>"; |
|
125 | - print "</td>"; |
|
126 | - |
|
127 | - print '</tr>' . "\n"; |
|
128 | - } |
|
77 | + foreach ($groups as $g) { |
|
78 | + //cast |
|
79 | + $g = (array) $g; |
|
80 | + |
|
81 | + print '<tr>' . "\n"; |
|
82 | + print ' <td><strong>' . $g['g_name'] . '</strong></td>'. "\n"; |
|
83 | + print ' <td>' . $g['g_desc'] . '</td>'. "\n"; |
|
84 | + # users in group |
|
85 | + print " <td>"; |
|
86 | + $u = $Admin->group_fetch_users($g['g_id']); |
|
87 | + if(sizeof($u)>0) { |
|
88 | + foreach($u as $name) { |
|
89 | + # get details |
|
90 | + $user = $Admin->fetch_object("users", "id", $name); |
|
91 | + print $user->real_name."<br>"; |
|
92 | + } |
|
93 | + } else { |
|
94 | + print "<span class='text-muted'>"._("No users")."</span>"; |
|
95 | + } |
|
96 | + print "</td>"; |
|
97 | + |
|
98 | + # section permissions |
|
99 | + print " <td>"; |
|
100 | + $permissions = $Sections->get_group_section_permissions ($g['g_id']); |
|
101 | + if(sizeof($permissions)>0) { |
|
102 | + foreach($permissions as $sec=>$perm) { |
|
103 | + # reformat permissions |
|
104 | + $perm = $Subnets->parse_permissions($perm); |
|
105 | + print $sec." : <span class='badge badge1 badge5'>".$perm."</span><br>"; |
|
106 | + } |
|
107 | + } |
|
108 | + print "</td>"; |
|
109 | + |
|
110 | + |
|
111 | + # add/remove users |
|
112 | + print " <td class='actions'>"; |
|
113 | + print " <div class='btn-group'>"; |
|
114 | + print " <button class='btn btn-xs btn-default addToGroup' data-groupid='$g[g_id]' data-action='add' rel='tooltip' data-container='body' title='"._('add users to this group')."'> <i class='fa fa-plus'></i></button>"; |
|
115 | + print " <button class='btn btn-xs btn-default removeFromGroup' data-groupid='$g[g_id]' data-action='remove' rel='tooltip' data-container='body' title='"._('remove users from this group')."'><i class='fa fa-minus'></i></button>"; |
|
116 | + print " </div>"; |
|
117 | + print "</td>"; |
|
118 | + |
|
119 | + # edit, delete |
|
120 | + print "<td class='actions'>"; |
|
121 | + print " <div class='btn-group'>"; |
|
122 | + print " <button class='btn btn-xs btn-default editGroup' data-groupid='$g[g_id]' data-action='edit' rel='tooltip' data-container='body' title='"._('edit group details')."'> <i class='fa fa-pencil'></i></button>"; |
|
123 | + print " <button class='btn btn-xs btn-default editGroup' data-groupid='$g[g_id]' data-action='delete' rel='tooltip' data-container='body' title='"._('remove group')."'> <i class='fa fa-times'></i></button>"; |
|
124 | + print " </div>"; |
|
125 | + print "</td>"; |
|
126 | + |
|
127 | + print '</tr>' . "\n"; |
|
128 | + } |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | ?> |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | |
23 | 23 | # parse result |
24 | 24 | foreach($_POST as $k=>$p) { |
25 | - if(substr($k, 0,4) == "user") { |
|
26 | - $users[substr($k, 4)] = substr($k, 4); |
|
27 | - } |
|
25 | + if(substr($k, 0,4) == "user") { |
|
26 | + $users[substr($k, 4)] = substr($k, 4); |
|
27 | + } |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
@@ -33,31 +33,31 @@ discard block |
||
33 | 33 | |
34 | 34 | # add each user to group |
35 | 35 | if(sizeof($users)>0) { |
36 | - foreach($users as $key=>$u) { |
|
37 | - if(!$Admin->add_group_to_user($_POST['gid'], $u)) { |
|
38 | - # get user details |
|
39 | - $user = $Admin->fetch_object("users", "id", $u); |
|
40 | - $errors[] = $user->real_name; |
|
41 | - } |
|
42 | - } |
|
36 | + foreach($users as $key=>$u) { |
|
37 | + if(!$Admin->add_group_to_user($_POST['gid'], $u)) { |
|
38 | + # get user details |
|
39 | + $user = $Admin->fetch_object("users", "id", $u); |
|
40 | + $errors[] = $user->real_name; |
|
41 | + } |
|
42 | + } |
|
43 | 43 | } |
44 | 44 | else { |
45 | - $errors[] = _("Please select user(s) to add to selected group!"); |
|
45 | + $errors[] = _("Please select user(s) to add to selected group!"); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | # print result |
49 | 49 | if(isset($errors)) { |
50 | - print "<div class='alert alert alert-danger'>"; |
|
51 | - print _("Failed to add users").":<hr>"; |
|
52 | - print "<ul>"; |
|
53 | - foreach($errors as $e) { |
|
54 | - print "<li>$e</li>"; |
|
55 | - } |
|
56 | - print "</ul>"; |
|
57 | - print "</div>"; |
|
50 | + print "<div class='alert alert alert-danger'>"; |
|
51 | + print _("Failed to add users").":<hr>"; |
|
52 | + print "<ul>"; |
|
53 | + foreach($errors as $e) { |
|
54 | + print "<li>$e</li>"; |
|
55 | + } |
|
56 | + print "</ul>"; |
|
57 | + print "</div>"; |
|
58 | 58 | } |
59 | 59 | else { |
60 | - $Result->show("success", _('Users added to group'), true); |
|
60 | + $Result->show("success", _('Users added to group'), true); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | ?> |
64 | 64 | \ No newline at end of file |
@@ -49,24 +49,24 @@ |
||
49 | 49 | </tr> |
50 | 50 | |
51 | 51 | <?php |
52 | - # show missing |
|
53 | - foreach($missing as $k=>$m) { |
|
54 | - # get user details |
|
55 | - $u = (array) $Admin->fetch_object("users", "id", $m); |
|
52 | + # show missing |
|
53 | + foreach($missing as $k=>$m) { |
|
54 | + # get user details |
|
55 | + $u = (array) $Admin->fetch_object("users", "id", $m); |
|
56 | 56 | |
57 | - print "<tr>"; |
|
57 | + print "<tr>"; |
|
58 | 58 | |
59 | - print " <td>"; |
|
60 | - print " <input type='checkbox' name='user$u[id]'>"; |
|
61 | - print " </td>"; |
|
59 | + print " <td>"; |
|
60 | + print " <input type='checkbox' name='user$u[id]'>"; |
|
61 | + print " </td>"; |
|
62 | 62 | |
63 | - print " <td>$u[real_name]</td>"; |
|
64 | - print " <td>$u[username]</td>"; |
|
65 | - print " <td>$u[email]</td>"; |
|
63 | + print " <td>$u[real_name]</td>"; |
|
64 | + print " <td>$u[username]</td>"; |
|
65 | + print " <td>$u[email]</td>"; |
|
66 | 66 | |
67 | - print "</tr>"; |
|
68 | - } |
|
69 | - ?> |
|
67 | + print "</tr>"; |
|
68 | + } |
|
69 | + ?> |
|
70 | 70 | |
71 | 71 | </table> |
72 | 72 | </form> |
@@ -28,15 +28,15 @@ |
||
28 | 28 | <option value="switch"><?php print _('Device'); ?></option> |
29 | 29 | <option value="port"><?php print _('Port'); ?></option> |
30 | 30 | <?php |
31 | - # fetch custom fields |
|
32 | - $custom = $Tools->fetch_custom_fields('ipaddresses'); |
|
31 | + # fetch custom fields |
|
32 | + $custom = $Tools->fetch_custom_fields('ipaddresses'); |
|
33 | 33 | |
34 | - if(sizeof($custom) > 0) { |
|
35 | - foreach($custom as $myField) { |
|
36 | - print '<option value="'. $myField['name'] .'"> '. $myField['name'] .'</option>'; |
|
37 | - } |
|
38 | - } |
|
39 | - ?> |
|
34 | + if(sizeof($custom) > 0) { |
|
35 | + foreach($custom as $myField) { |
|
36 | + print '<option value="'. $myField['name'] .'"> '. $myField['name'] .'</option>'; |
|
37 | + } |
|
38 | + } |
|
39 | + ?> |
|
40 | 40 | </select> |
41 | 41 | </td> |
42 | 42 | </tr> |
@@ -24,12 +24,12 @@ |
||
24 | 24 | if(empty($_POST['search'])) { $Result->show("danger", _('Please enter something in search field').'!', true); } |
25 | 25 | //if device verify that it exists |
26 | 26 | if($_POST['field'] == "switch") { |
27 | - if(!$device1 = $Admin->fetch_object("devices", "hostname", $_POST['search'])) { $Result->show("danger alert-absolute", _('Switch').' "<i>'. $_POST['search'] .'</i>" '._('does not exist, first create switch under admin menu').'!', true); } |
|
28 | - if(!$device2 = $Admin->fetch_object("devices", "hostname", $_POST['replace'])) { $Result->show("danger alert-absolute", _('Switch').' "<i>'. $_POST['search'] .'</i>" '._('does not exist, first create switch under admin menu').'!', true); } |
|
27 | + if(!$device1 = $Admin->fetch_object("devices", "hostname", $_POST['search'])) { $Result->show("danger alert-absolute", _('Switch').' "<i>'. $_POST['search'] .'</i>" '._('does not exist, first create switch under admin menu').'!', true); } |
|
28 | + if(!$device2 = $Admin->fetch_object("devices", "hostname", $_POST['replace'])) { $Result->show("danger alert-absolute", _('Switch').' "<i>'. $_POST['search'] .'</i>" '._('does not exist, first create switch under admin menu').'!', true); } |
|
29 | 29 | |
30 | - //replace posts |
|
31 | - $_POST['search'] = $device1->id; |
|
32 | - $_POST['replace'] = $device2->id; |
|
30 | + //replace posts |
|
31 | + $_POST['search'] = $device1->id; |
|
32 | + $_POST['replace'] = $device2->id; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | # update |
@@ -37,33 +37,33 @@ discard block |
||
37 | 37 | |
38 | 38 | <tbody> |
39 | 39 | <?php |
40 | - # print requests |
|
41 | - foreach($active_requests as $k=>$request) { |
|
42 | - //cast |
|
43 | - $request = (array) $request; |
|
44 | - |
|
45 | - //get subnet details |
|
46 | - $subnet = (array) $Subnets->fetch_subnet (null, $request['subnetId']); |
|
47 | - |
|
48 | - //valid |
|
49 | - if(sizeof($subnet)==0 || @$subnet[0]===false) { |
|
50 | - unset($active_requests[$k]); |
|
51 | - } |
|
52 | - else { |
|
53 | - // ip not provided |
|
54 | - $request['ip_addr'] = strlen($request['ip_addr'])>0 ? $request['ip_addr'] : _("Automatic"); |
|
55 | - |
|
56 | - print '<tr>'. "\n"; |
|
57 | - print " <td><button class='btn btn-sm btn-default' data-requestid='$request[id]'><i class='fa fa-pencil'></i> "._('Process')."</button></td>"; |
|
58 | - print ' <td>'. $request['ip_addr'] .'</td>'. "\n"; |
|
59 | - print ' <td>'. $Subnets->transform_to_dotted($subnet['subnet']) .'/'. $subnet['mask'] .' ('. $subnet['description'] .')</td>'. "\n"; |
|
60 | - print ' <td>'. $request['dns_name'] .'</td>'. "\n"; |
|
61 | - print ' <td>'. $request['description'] .'</td>'. "\n"; |
|
62 | - print ' <td>'. $request['requester'] .'</td>'. "\n"; |
|
63 | - print ' <td>'. $request['comment'] .'</td>'. "\n"; |
|
64 | - print '</tr>'. "\n"; |
|
65 | - } |
|
66 | - } |
|
40 | + # print requests |
|
41 | + foreach($active_requests as $k=>$request) { |
|
42 | + //cast |
|
43 | + $request = (array) $request; |
|
44 | + |
|
45 | + //get subnet details |
|
46 | + $subnet = (array) $Subnets->fetch_subnet (null, $request['subnetId']); |
|
47 | + |
|
48 | + //valid |
|
49 | + if(sizeof($subnet)==0 || @$subnet[0]===false) { |
|
50 | + unset($active_requests[$k]); |
|
51 | + } |
|
52 | + else { |
|
53 | + // ip not provided |
|
54 | + $request['ip_addr'] = strlen($request['ip_addr'])>0 ? $request['ip_addr'] : _("Automatic"); |
|
55 | + |
|
56 | + print '<tr>'. "\n"; |
|
57 | + print " <td><button class='btn btn-sm btn-default' data-requestid='$request[id]'><i class='fa fa-pencil'></i> "._('Process')."</button></td>"; |
|
58 | + print ' <td>'. $request['ip_addr'] .'</td>'. "\n"; |
|
59 | + print ' <td>'. $Subnets->transform_to_dotted($subnet['subnet']) .'/'. $subnet['mask'] .' ('. $subnet['description'] .')</td>'. "\n"; |
|
60 | + print ' <td>'. $request['dns_name'] .'</td>'. "\n"; |
|
61 | + print ' <td>'. $request['description'] .'</td>'. "\n"; |
|
62 | + print ' <td>'. $request['requester'] .'</td>'. "\n"; |
|
63 | + print ' <td>'. $request['comment'] .'</td>'. "\n"; |
|
64 | + print '</tr>'. "\n"; |
|
65 | + } |
|
66 | + } |
|
67 | 67 | ?> |
68 | 68 | </tbody> |
69 | 69 | </table> |
@@ -92,32 +92,32 @@ discard block |
||
92 | 92 | |
93 | 93 | <tbody> |
94 | 94 | <?php |
95 | - # print requests |
|
96 | - foreach($inactive_requests as $k=>$request) { |
|
97 | - //cast |
|
98 | - $request = (array) $request; |
|
99 | - |
|
100 | - //get subnet details |
|
101 | - $subnet = (array) $Subnets->fetch_subnet (null, $request['subnetId']); |
|
102 | - |
|
103 | - //valid |
|
104 | - if(sizeof($subnet)==0 || @$subnet[0]===false) { |
|
105 | - unset($inactive_requests[$k]); |
|
106 | - } |
|
107 | - else { |
|
108 | - print '<tr>'. "\n"; |
|
109 | - print ' <td>'. $Subnets->transform_to_dotted($subnet['subnet']) .'/'. $subnet['mask'] .' ('. $subnet['description'] .')</td>'. "\n"; |
|
110 | - print ' <td>'. $request['dns_name'] .'</td>'. "\n"; |
|
111 | - print ' <td>'. $request['description'] .'</td>'. "\n"; |
|
112 | - print ' <td>'. $request['requester'] .'</td>'. "\n"; |
|
113 | - print ' <td>'. $request['comment'] .'</td>'. "\n"; |
|
114 | - print ' <td>'. $request['adminComment'] .'</td>'. "\n"; |
|
115 | - print ' <td>'; |
|
116 | - print $request['accepted']==1 ? "Yes" : "No"; |
|
117 | - print '</td>'. "\n"; |
|
118 | - print '</tr>'. "\n"; |
|
119 | - } |
|
120 | - } |
|
95 | + # print requests |
|
96 | + foreach($inactive_requests as $k=>$request) { |
|
97 | + //cast |
|
98 | + $request = (array) $request; |
|
99 | + |
|
100 | + //get subnet details |
|
101 | + $subnet = (array) $Subnets->fetch_subnet (null, $request['subnetId']); |
|
102 | + |
|
103 | + //valid |
|
104 | + if(sizeof($subnet)==0 || @$subnet[0]===false) { |
|
105 | + unset($inactive_requests[$k]); |
|
106 | + } |
|
107 | + else { |
|
108 | + print '<tr>'. "\n"; |
|
109 | + print ' <td>'. $Subnets->transform_to_dotted($subnet['subnet']) .'/'. $subnet['mask'] .' ('. $subnet['description'] .')</td>'. "\n"; |
|
110 | + print ' <td>'. $request['dns_name'] .'</td>'. "\n"; |
|
111 | + print ' <td>'. $request['description'] .'</td>'. "\n"; |
|
112 | + print ' <td>'. $request['requester'] .'</td>'. "\n"; |
|
113 | + print ' <td>'. $request['comment'] .'</td>'. "\n"; |
|
114 | + print ' <td>'. $request['adminComment'] .'</td>'. "\n"; |
|
115 | + print ' <td>'; |
|
116 | + print $request['accepted']==1 ? "Yes" : "No"; |
|
117 | + print '</td>'. "\n"; |
|
118 | + print '</tr>'. "\n"; |
|
119 | + } |
|
120 | + } |
|
121 | 121 | ?> |
122 | 122 | </tbody> |
123 | 123 | </table> |
@@ -7,24 +7,24 @@ |
||
7 | 7 | |
8 | 8 | foreach($admin_menu as $k=>$menu) { |
9 | 9 | |
10 | - # headers |
|
11 | - print "<h4>"._($k)."</h4>"; |
|
12 | - print "<hr>"; |
|
10 | + # headers |
|
11 | + print "<h4>"._($k)."</h4>"; |
|
12 | + print "<hr>"; |
|
13 | 13 | |
14 | - # items |
|
15 | - foreach($menu as $t) { |
|
16 | - print " <div class='col-xs-12 col-md-6 col-lg-6 widget-dash'>"; |
|
17 | - print " <div class='inner thumbnail'>"; |
|
18 | - print " <div class='hContent'>"; |
|
19 | - print " <div class='icon'><a href='".create_link("administration",$t['href'])."'><i class='fa $t[icon]'></i></a></div>"; |
|
20 | - print " <div class='text'><a href='".create_link("administration",$t['href'])."'>"._($t['name'])."</a><hr><span class='text-muted'>"._($t['description'])."</span></div>"; |
|
21 | - print " </div>"; |
|
22 | - print " </div>"; |
|
23 | - print " </div>"; |
|
24 | - } |
|
14 | + # items |
|
15 | + foreach($menu as $t) { |
|
16 | + print " <div class='col-xs-12 col-md-6 col-lg-6 widget-dash'>"; |
|
17 | + print " <div class='inner thumbnail'>"; |
|
18 | + print " <div class='hContent'>"; |
|
19 | + print " <div class='icon'><a href='".create_link("administration",$t['href'])."'><i class='fa $t[icon]'></i></a></div>"; |
|
20 | + print " <div class='text'><a href='".create_link("administration",$t['href'])."'>"._($t['name'])."</a><hr><span class='text-muted'>"._($t['description'])."</span></div>"; |
|
21 | + print " </div>"; |
|
22 | + print " </div>"; |
|
23 | + print " </div>"; |
|
24 | + } |
|
25 | 25 | |
26 | - # clear and break |
|
27 | - print "<div class='clearfix'></div>"; |
|
26 | + # clear and break |
|
27 | + print "<div class='clearfix'></div>"; |
|
28 | 28 | } |
29 | 29 | ?> |
30 | 30 | </div> |
@@ -24,11 +24,11 @@ |
||
24 | 24 | |
25 | 25 | # get posted permissions |
26 | 26 | foreach($_POST as $key=>$val) { |
27 | - if(substr($key, 0,5) == "group") { |
|
28 | - if($val != 0) { |
|
29 | - $perm[substr($key,5)] = $val; |
|
30 | - } |
|
31 | - } |
|
27 | + if(substr($key, 0,5) == "group") { |
|
28 | + if($val != 0) { |
|
29 | + $perm[substr($key,5)] = $val; |
|
30 | + } |
|
31 | + } |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | # set values and update |