diff --git a/res/forum/api/user_info.php b/res/forum/api/user_info.php new file mode 100644 index 0000000..0e70239 --- /dev/null +++ b/res/forum/api/user_info.php @@ -0,0 +1,26 @@ + 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; +} + +if (!isset($_GET["username"])) return; + +$out = $database -> query("SELECT username, admin FROM user WHERE username=\"" . $_GET["username"] . "\""); + +while ($res = $out -> fetch_assoc()) +{ + echo "Uživatelské jméno: " . $res["username"] . "
"; + echo "Admin: " . ($res["admin"] == 1 ? "Ano" : "Ne"); +} \ No newline at end of file