+
+# user login and control
+
+include_once 'auth.inc.php'; // sets global $User
+
+if ($Page->restricted) {
+ # access restriction
+ if (!$User->login) {
+ $target = urlencode($Page->link);
+ abort("/login?goto=$target", '303 Eerst inloggen');
+ }
+ elseif ($check = file_get_contents("{$Page->restricted}/.private")
+ and !$User->admin(trim($check))) {
+ http_response_code(403);
+ $Page->raw('403.inc.html');
+ }