secured list_table

This commit is contained in:
Václav Šmejkal 2024-05-20 20:03:59 +02:00
parent 697f0c5f96
commit 627fd8ac7b
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -1,6 +1,20 @@
<?php <?php
include("../global.php"); include("../global.php");
session_start();
if (!isset($_SESSION["username"])) goto fail;
$out = $database -> query("SELECT username, admin FROM user WHERE username=\"" . $_SESSION["username"] . "\" AND admin=\"1\"");
if ($out -> num_rows != 1)
{
fail:
echo "nope";
header("Location: ../../index.php");
return;
}
$out = $database -> query("SELECT username FROM user ORDER BY id ASC"); $out = $database -> query("SELECT username FROM user ORDER BY id ASC");