diff options
| author | Justin J. Novack <jnovack@gmail.com> | 2012-09-17 09:53:19 -0400 |
|---|---|---|
| committer | Justin J. Novack <jnovack@gmail.com> | 2012-09-17 09:53:19 -0400 |
| commit | 76aa2ab76d8f2305db7a2bb7cdbe461cca0146a3 (patch) | |
| tree | e8a3a9cdab77505a14c71e24529b988433d57fdb /www/secure.php | |
| parent | 2935763e253c3616d951bc18c7d21a56349531fa (diff) | |
| download | phorkie-76aa2ab76d8f2305db7a2bb7cdbe461cca0146a3.tar.gz phorkie-76aa2ab76d8f2305db7a2bb7cdbe461cca0146a3.zip | |
ADD: Add identity to /forbidden page for easy administration
Diffstat (limited to 'www/secure.php')
| -rw-r--r-- | www/secure.php | 8 |
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; + } +} ?> |
