diff options
| author | Connor Thomson <blumatrikz@gmail.com> | 2026-09-20 21:23:09 -0700 |
|---|---|---|
| committer | Connor Thomson <blumatrikz@gmail.com> | 2026-09-20 21:23:09 -0700 |
| commit | 070a27baa8f93c3bf191459b88d24d7430a78899 (patch) | |
| tree | 8c96b12d16e1d219ef410ad0e45b2d886368bc5e /php/user.php | |
| parent | 83cd353b01660f34d6fd894d15a27fb1b3aeab4c (diff) | |
Some fixes and updates
Diffstat (limited to 'php/user.php')
| -rw-r--r-- | php/user.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/php/user.php b/php/user.php index 8a424e5..9521dc5 100644 --- a/php/user.php +++ b/php/user.php @@ -19,6 +19,7 @@ require_once ROOT . '/php/session.php'; require_once ROOT . '/php/database.php'; +require_once ROOT . '/php/render.php'; const USER_STATUSES = ['none', 'member', 'mod', 'admin']; @@ -46,4 +47,15 @@ function is_admin(): bool { return $user !== null && $user['status'] === 'admin'; } +function require_admin(): void { + if (is_admin()) { + return; + } + + http_response_code(403); + + render_content(ROOT . '/html/forbidden.html'); + exit; +} + ?> |
