From 371800f1cb0987b3d77d9babceb4ffd99e8cd060 Mon Sep 17 00:00:00 2001 From: Connor Thomson Date: Sun, 20 Sep 2026 21:59:08 -0700 Subject: Remove forbidden.html and make it so require_admin() gives more info if it fails --- html/forbidden.html | 21 --------------------- php/user.php | 7 +++++-- 2 files changed, 5 insertions(+), 23 deletions(-) delete mode 100755 html/forbidden.html diff --git a/html/forbidden.html b/html/forbidden.html deleted file mode 100755 index 791fa4e..0000000 --- a/html/forbidden.html +++ /dev/null @@ -1,21 +0,0 @@ - - -

403 Forbidden

-
-

You do not have permission to view this page.

diff --git a/php/user.php b/php/user.php index 9521dc5..7eafd20 100644 --- a/php/user.php +++ b/php/user.php @@ -52,9 +52,12 @@ function require_admin(): void { return; } - http_response_code(403); + if (get_user_id() === null) { + http_response_code(401); + } else { + http_response_code(403); + } - render_content(ROOT . '/html/forbidden.html'); exit; } -- cgit v1.2.3