X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/97c4ac59eed8b66b2e7f85d8ac325b063fb8a0ce..91e9d451126b1165a564f5f211082dce3b0348d9:/www/secure.php diff --git a/www/secure.php b/www/secure.php index 4b81d59..9506614 100644 --- a/www/secure.php +++ b/www/secure.php @@ -6,14 +6,20 @@ namespace phorkie; require_once 'www-header.php'; $_SESSION['REQUEST_URI'] = $_SERVER['REQUEST_URI']; if (!isset($_SESSION['identity'])) { - header("Location: /login"); + header("Location: " . Tools::fullUrl('/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)); + header('HTTP/1.1 403 Forbidden'); + $db = new Database(); + render( + 'forbidden', + array( + 'recents' => $db->getSearch()->listAll(0, 5, 'crdate', 'desc'), + ) + ); exit; } }