-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.php
More file actions
54 lines (52 loc) · 1.62 KB
/
index.php
File metadata and controls
54 lines (52 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
include("assets/php/database.php");
include("assets/php/class.acl.php");
$userID = $_SESSION['userID'];
$userID = (isset($_GET['userID']) && $_GET['userID'] > 0 ? $_GET['userID'] : $userID);
$_SESSION['userID'] = $userID;
$myACL = new ACL();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ACL Test</title>
<link href="assets/css/styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header"></div>
<div id="adminButton"><a href="admin/">Admin Page</a></div>
<div id="page">
<?php if(isset($_GET['no_perm'])): ?>
<div class="error">You don't have access to Admin Page</div>
<?php endif; ?>
<h2>Permissions for <?= $myACL->getUsername($userID); ?>:</h2>
<?
$userACL = new ACL($userID);
$aPerms = $userACL->getAllPerms('full');
foreach ($aPerms as $k => $v)
{
echo "<strong>" . $v['Name'] . ": </strong>";
echo "<img src=\"assets/img/";
if ($userACL->hasPermission($v['Key']) === true)
{
echo "allow.png";
$pVal = "Allow";
} else {
echo "deny.png";
$pVal = "Deny";
}
echo "\" width=\"16\" height=\"16\" alt=\"$pVal\" /><br />";
}
?>
<h3>Change User:</h3>
<?
$strSQL = "SELECT * FROM `users` ORDER BY `Username` ASC";
$data = mysql_query($strSQL);
while ($row = mysql_fetch_assoc($data))
{
echo "<a href=\"?userID=" . $row['ID'] . "\">" . $row['username'] . "</a><br />";
}
?>
</div>
</body>
</html>