10 lines
307 B
PHP
10 lines
307 B
PHP
|
<?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]);
|