From d5c1e3c13f47a4694ada87534f3babd422b8f6b6 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 22 May 2024 21:09:41 +0200 Subject: [PATCH] created api for checking if user is admin --- res/forum/api/is_admin.php | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 res/forum/api/is_admin.php diff --git a/res/forum/api/is_admin.php b/res/forum/api/is_admin.php new file mode 100644 index 0000000..ab90db2 --- /dev/null +++ b/res/forum/api/is_admin.php @@ -0,0 +1,10 @@ + ($database -> query("SELECT username, admin FROM user WHERE username=\"" . $_SESSION["username"] . "\" AND admin=1")) -> num_rows == 1]); \ No newline at end of file