page: redirect to login on access denial
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 27 Sep 2017 22:59:28 +0000 (00:59 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 27 Sep 2017 23:00:22 +0000 (01:00 +0200)
page.php

index 4120a01bd05b4d0a476fe88c5eebbecc51327e90..6623c8b39c2281de2038d4dc6ae7e43df58992db 100644 (file)
--- 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;