created api for checking if user is admin
This commit is contained in:
parent
4a46719b46
commit
d5c1e3c13f
10
res/forum/api/is_admin.php
Normal file
10
res/forum/api/is_admin.php
Normal file
@ -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]);
|
Loading…
x
Reference in New Issue
Block a user