diff --git a/libs/auth.php b/libs/auth.php index 3689108..12ee5e7 100755 --- a/libs/auth.php +++ b/libs/auth.php @@ -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']; ?> + + + +

Banned

+

You are banned for .

+ + + \ No newline at end of file +?> diff --git a/libs/page.php b/libs/page.php index 890ab3c..74744ab 100755 --- a/libs/page.php +++ b/libs/page.php @@ -28,4 +28,4 @@ \ No newline at end of file +?> diff --git a/scripts/init.sql b/scripts/init.sql index 4a485d7..ad101b5 100755 --- a/scripts/init.sql +++ b/scripts/init.sql @@ -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); \ No newline at end of file +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);