-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·55 lines (52 loc) · 2.43 KB
/
index.php
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
55
<?php
include "./config.php";
include $healthbox_config["auth"]["provider"]["core"];
if ($_SESSION['authid'] !== "dropauth") { // Check to see if the user is not signed in.
header("Location: ./landing.php");
exit();
}
if (in_array($username, $healthbox_config["auth"]["access"]["admin"]) == false) {
if ($healthbox_config["auth"]["access"]["mode"] == "whitelist") {
if (in_array($username, $healthbox_config["auth"]["access"]["whitelist"]) == false) { // Check to make sure this user is not in blacklist.
echo "<p>You are not permitted to access this utility.</p>";
exit();
}
} else if ($healthbox_config["auth"]["access"]["mode"] == "blacklist") {
if (in_array($username, $healthbox_config["auth"]["access"]["blacklist"]) == true) { // Check to make sure this user is not in blacklist.
echo "<p>You are not permitted to access this utility.</p>";
exit();
}
} else {
echo "<p>The configured access mode is invalid.</p>";
exit();
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HealthBox - Dashboard</title>
<link rel="stylesheet" href="./assets/styles/main.css">
<link rel="stylesheet" href="./assets/fonts/lato/latofonts.css">
</head>
<body>
<main>
<div class="navbar" role="navigation">
<a class="button" role="button" href="<?php echo $healthbox_config["auth"]["provider"]["signout"]; ?>">Logout</a>
<a class="button" role="button" href="./management.php">Management</a>
<?php
if (in_array($username, $healthbox_config["auth"]["access"]["admin"]) == true) { // Check to see if this user is an administrator.
echo '<a class="button" role="button" href="./configure.php">Configure</a>';
}
?>
</div>
<h1><span style="color:#ff55aa">Health</span><span style="padding:3px;border-radius:10px;background:#ff55aa;">Box</span></h1>
<h2>Dashboard</h2>
<hr>
<a class="button" role="button" href="./manageservices.php">Manage Services</a>
<a class="button" role="button" href="./managedata.php">Manage Data</a>
<a class="button" role="button" href="./managefood.php">Manage Food</a>
</main>
</body>
</html>