This commit is contained in:
biglyderv 2024-12-07 09:10:36 -05:00
parent d3f8c1ae17
commit 3a34471306
3 changed files with 20 additions and 5 deletions

View file

@ -20,8 +20,22 @@
$result = $stmt->fetch(PDO::FETCH_ASSOC); $result = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$result) return null; if (!$result) return null;
return $username; $stmt = $db->prepare("SELECT * FROM main.ban WHERE username = ?");
} $stmt->execute([$username]);
$result = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$result) return $username;
$reason = $result['reason']; ?>
<!DOCTYPE html>
<html>
<body>
<h1>Banned</h1>
<p>You are banned for <?php echo $reason?>.</p>
</body>
</html>
<?php die();
}
if (array_key_exists('token',$_COOKIE)) { if (array_key_exists('token',$_COOKIE)) {
$username = auth($_COOKIE['token']); $username = auth($_COOKIE['token']);

View file

@ -3,4 +3,5 @@ CREATE TABLE IF NOT EXISTS main.token (username TEXT, token TEXT);
CREATE TABLE IF NOT EXISTS main.user (username TEXT, bio TEXT); CREATE TABLE IF NOT EXISTS main.user (username TEXT, bio TEXT);
CREATE TABLE IF NOT EXISTS main.role (username TEXT, role TEXT); CREATE TABLE IF NOT EXISTS main.role (username TEXT, role TEXT);
CREATE TABLE IF NOT EXISTS main.follow (username TEXT, target TEXT); CREATE TABLE IF NOT EXISTS main.follow (username TEXT, target TEXT);
CREATE TABLE IF NOT EXISTS main.ban (username TEXT, reason TEXT);
CREATE TABLE IF NOT EXISTS main.comment (username TEXT, targetType TEXT, targetId TEXT, date REAL, content TEXT, id TEXT); CREATE TABLE IF NOT EXISTS main.comment (username TEXT, targetType TEXT, targetId TEXT, date REAL, content TEXT, id TEXT);