From 94c57fa247ba107fce8fc1d1fc355191229dbddc Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 8 Aug 2021 22:31:51 +0200 Subject: Permissions system --- admin/private/permissions.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 admin/private/permissions.php (limited to 'admin/private/permissions.php') diff --git a/admin/private/permissions.php b/admin/private/permissions.php new file mode 100644 index 0000000..6ad7057 --- /dev/null +++ b/admin/private/permissions.php @@ -0,0 +1,37 @@ + $uperms) { + if ($user === $_DATA['id']) { + if (in_array($requested, $uperms)) { + $permsOkay = true; + } + } +} + +if (!$permsOkay && $requested !== "denied") { + if (isset($_PERMSFORAPI) && $_PERMSFORAPI) { + $_GET['_'] = "api." . $requested; + ob_end_clean(); + require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/panes/denied.php"; + die(); + } else if (isset($_PERMSFORSSO) && $_PERMSFORSSO) { + $_GET['_'] = "sso." . $requested; + ob_end_clean(); + require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/panes/denied.php"; + die(); + } else { + $_GET['_'] = "dom." . $requested; + ob_end_clean(); + require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/panes/denied.php"; + die(); + } +} \ No newline at end of file -- cgit