diff options
author | Minteck <contact@minteck.org> | 2022-09-21 22:42:33 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-09-21 22:42:33 +0200 |
commit | e95b208af90cc386a7d8d1bcab426727cf4f0121 (patch) | |
tree | b293e0c644513fbeb6e9ad29be97fa6347a55e9f /includes/init.php | |
parent | b5f589c323f415bb42ea7069cb4d1a8a2233dd69 (diff) | |
download | pluralconnect-e95b208af90cc386a7d8d1bcab426727cf4f0121.tar.gz pluralconnect-e95b208af90cc386a7d8d1bcab426727cf4f0121.tar.bz2 pluralconnect-e95b208af90cc386a7d8d1bcab426727cf4f0121.zip |
Update time
Diffstat (limited to 'includes/init.php')
-rw-r--r-- | includes/init.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/includes/init.php b/includes/init.php new file mode 100644 index 0000000..71d7def --- /dev/null +++ b/includes/init.php @@ -0,0 +1,18 @@ +<?php + +global $title; +global $toplevel; +global $pages; + +$pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; + +if (in_array($toplevel, array_keys($pages))) { + $title = $pages[$toplevel]["name"]; + + if ($pages[$toplevel]["admin"]) { + if (!$isLoggedIn) header("Location: /-/login/?return=$toplevel") and die(); + } +} else { + $title = $toplevel; +}
\ No newline at end of file |