From: Mischa POSLAWSKY Date: Wed, 27 Sep 2017 22:59:28 +0000 (+0200) Subject: page: redirect to login on access denial X-Git-Tag: v2.3~16 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/396a686c85aa2a7fe3057da642382a12124b69bf page: redirect to login on access denial --- diff --git a/page.php b/page.php index 4120a01..6623c8b 100644 --- a/page.php +++ b/page.php @@ -62,10 +62,9 @@ while (TRUE) { if (file_exists("$Page/.private")) { # access restriction if (!isset($User)) { - http_response_code(403); - include_once 'page.inc.php'; - ob_start(); - @require_once './403.html'; + http_response_code(303); + $target = urlencode($_SERVER['REQUEST_URI']); + header("Location: /login?goto=$target"); exit; } $PageAccess = $Page;