diff options
| -rwxr-xr-x | html/forbidden.html | 21 | ||||
| -rw-r--r-- | php/user.php | 7 |
2 files changed, 5 insertions, 23 deletions
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 @@ -<!-- - GNUfault.org - GNUfault's website - Copyright (C) 2026 Connor Thomson - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. ---> - -<h2>403 Forbidden</h2> -<hr> -<p>You do not have permission to view this page.</p> 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; } |
