diff options
| author | ilotterytea <iltsu@alright.party> | 2025-12-11 00:29:32 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-12-11 00:29:32 +0500 |
| commit | 84ca542d26832d5d995a3106e7cbf0acc1ede6f3 (patch) | |
| tree | 2a0ed9cef68415b6a8fab580f81e71e6ca74d3e9 /system | |
| parent | 7e413a5d37346ec9512dca230f635dd57f1798e6 (diff) | |
feat: grant all permissions if user is admin
Diffstat (limited to 'system')
| -rw-r--r-- | system/config.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/system/config.php b/system/config.php index 8e1879d..e03e95b 100644 --- a/system/config.php +++ b/system/config.php @@ -4,8 +4,8 @@ include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/partials.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/alert.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/accounts.php"; -if (file_exists(CFG_PATH) && !authorize_user(true) && !isset($_SESSION['user_role']['permission_admin'])) { - generate_alert('/', 'Unauthorized', 401); +if (file_exists(CFG_PATH) && (!authorize_user(true) || !isset($_SESSION['user_role']) || !$_SESSION['user_role']['permission_admin'])) { + generate_alert('/404.php', 'Unauthorized', 401); exit(); } |
