aboutsummaryrefslogtreecommitdiff
path: root/www/secure.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/secure.php')
-rw-r--r--www/secure.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/www/secure.php b/www/secure.php
index 07cdfb6..4b81d59 100644
--- a/www/secure.php
+++ b/www/secure.php
@@ -9,4 +9,12 @@ if (!isset($_SESSION['identity'])) {
header("Location: /login");
exit;
}
+if ($GLOBALS['phorkie']['auth']['secure'] > 0 &&
+ $GLOBALS['phorkie']['auth']['userlist']) {
+ if (!in_array($_SESSION['identity'], $GLOBALS['phorkie']['users'])) {
+ $redirect = 'http://' . $_SERVER['HTTP_HOST'] . "/forbidden";
+ header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
+ exit;
+ }
+}
?>