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 @@ +<?php + +include("../../global.php"); +session_start(); + +header('Content-type: application/json'); + +if (!isset($_SESSION["username"])) return; + +echo json_encode(["admin" => ($database -> query("SELECT username, admin FROM user WHERE username=\"" . $_SESSION["username"] . "\" AND admin=1")) -> num_rows == 1]); \ No newline at end of file