10 lines
307 B
PHP
Raw Normal View History

<?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]);