ban
This commit is contained in:
parent
d3f8c1ae17
commit
3a34471306
3 changed files with 20 additions and 5 deletions
|
@ -20,7 +20,21 @@
|
||||||
$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)) {
|
||||||
|
|
|
@ -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);
|
Loading…
Reference in a new issue