ban
This commit is contained in:
parent
d3f8c1ae17
commit
3a34471306
3 changed files with 20 additions and 5 deletions
|
@ -19,11 +19,25 @@
|
|||
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if (!$result) return null;
|
||||
|
||||
$stmt = $db->prepare("SELECT * FROM main.ban WHERE username = ?");
|
||||
$stmt->execute([$username]);
|
||||
|
||||
return $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)) {
|
||||
$username = auth($_COOKIE['token']);
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -28,4 +28,4 @@
|
|||
</body>
|
||||
</html>
|
||||
<?php }
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -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.role (username TEXT, role TEXT);
|
||||
CREATE TABLE IF NOT EXISTS main.follow (username TEXT, target 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.ban (username TEXT, reason TEXT);
|
||||
CREATE TABLE IF NOT EXISTS main.comment (username TEXT, targetType TEXT, targetId TEXT, date REAL, content TEXT, id TEXT);
|
||||
|
|
Loading…
Reference in a new issue