<a href="perms.php" class="permissions">Permissions</a> </li> <li> <a href="admin_index.php" class="user_admin">User Admin</a> </li> </ul> </div> <div id="table-content"> <div id="page"> <?php if ($_GET['action'] == '') { ?> <h2>Select a Permission to Manage:</h2> <?php $roles = $myACL->getAllPerms('full'); foreach ($roles as $k => $v) { echo "<a href=\"?action=perm&permID=" . $v['ID'] . "\">" . $v['Name'] . "</a><br />"; } if (count($roles) < 1) { echo "No permissions yet.<br />"; } ?> <input type="button" name="New" value="New Permission" onclick="window.location='?action=perm'" /> <?php } if ($_GET['action'] == 'perm') { if ($_GET['permID'] == '') { ?> <h2>New Permission:</h2> <?php
)</h2><?php } ?> <form action="roles.php" method="post"> <label for="roleName">Name:</label> <input type="text" name="roleName" id="roleName" value="<?php echo $myACL->getRoleNameFromID($_GET['roleID']); ?> " /> <table border="0" cellpadding="5" cellspacing="0"> <tr> <th></th><th>Allow</th><th>Deny</th><th>Ignore</th> </tr> <?php $rPerms = $myACL->getRolePerms($_GET['roleID']); $aPerms = $myACL->getAllPerms('full'); foreach ($aPerms as $k => $v) { echo "\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td><label>" . $v['Name'] . "</label></td>"; echo "<td>\n\t\t\t\t\t\t\t\t\t\t<input type=\"radio\" name=\"perm_" . $v['ID'] . "\" id=\"perm_" . $v['ID'] . "_1\" value=\"1\""; if ($rPerms[$v['Key']]['value'] === true && $_GET['roleID'] != '') { echo " checked=\"checked\""; } echo " /></td>"; echo "<td><input type=\"radio\" name=\"perm_" . $v['ID'] . "\" id=\"perm_" . $v['ID'] . "_0\" value=\"0\""; if ($rPerms[$v['Key']]['value'] != true && $_GET['roleID'] != '') { echo " checked=\"checked\""; } echo " /></td>"; echo "<td><input type=\"radio\" name=\"perm_" . $v['ID'] . "\" id=\"perm_" . $v['ID'] . "_X\" value=\"X\""; if ($_GET['roleID'] == '' || !array_key_exists($v['Key'], $rPerms)) { echo " checked=\"checked\"";
<?php if ($_GET['action'] == 'perms') { ?> <h2>Manage User Permissions: (<?php echo $myACL->getUsername($_GET['userID']); ?> )</h2> <form action="users.php" method="post"> <table border="0" cellpadding="5" cellspacing="0"> <tr> <th></th><th></th> </tr> <?php $userACL = new ACL($_GET['userID']); $rPerms = $userACL->perms; $aPerms = $userACL->getAllPerms('full'); foreach ($aPerms as $k => $v) { echo "\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>" . $v['Name'] . "</td>"; echo "<td>\n\t\t\t\t\t\t\t\t\t\t<select name=\"perm_" . $v['ID'] . "\">"; echo "<option value=\"1\""; if ($userACL->hasPermission($v['Key']) && $rPerms[$v['Key']]['inheritted'] != true) { echo " selected=\"selected\""; } echo ">Allow</option>"; echo "<option value=\"0\""; if ($rPerms[$v['Key']]['value'] === false && $rPerms[$v['Key']]['inheritted'] != true) { echo " selected=\"selected\""; } echo ">Deny</option>"; echo "<option value=\"x\""; if ($rPerms[$v['Key']]['inheritted'] == true || !array_key_exists($v['Key'], $rPerms)) {