if (count($roles) < 1) { echo "No roles yet.<br />"; } ?> <input type="button" name="New" value="New Role" onclick="window.location='?action=role'" /> <?php } if ($_GET['action'] == 'role') { if ($_GET['roleID'] == '') { ?> <h2>New Role:</h2> <?php } else { ?> <h2>Manage Role: (<?php echo $myACL->getRoleNameFromID($_GET['roleID']); ?> )</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
<?php if ($_GET['action'] == 'user') { $userACL = new ACL($_GET['userID']); ?> <h2>Managing <?php echo $myACL->getUsername($_GET['userID']); ?> :</h2> ... Some form to edit user info ... <h3>Roles for user: (<a href="users.php?action=roles&userID=<?php echo $_GET['userID']; ?> ">Manage Roles</a>)</h3> <ul> <?php $roles = $userACL->getUserRoles(); foreach ($roles as $k => $v) { echo "\n\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t" . $userACL->getRoleNameFromID($v) . "\n\t\t\t\t\t\t\t\t</li>"; } ?> </ul> <h3>Permissions for user: (<a href="users.php?action=perms&userID=<?php echo $_GET['userID']; ?> ">Manage Permissions</a>)</h3> <ul> <?php $perms = $userACL->perms; foreach ($perms as $k => $v) { if ($v['value'] === false) { continue; } echo "\n\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t" . $v['Name']; if ($v['inheritted']) {