mirror of
https://git.sr.ht/~iwakuralain/text0Nly
synced 2025-07-27 15:36:11 +00:00
added unban xd
This commit is contained in:
parent
71dd22c304
commit
da3dc76280
@ -45,6 +45,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$error = "Username already banned";
|
||||
}
|
||||
}
|
||||
} elseif ($_POST['action'] === 'preventive_unban') {
|
||||
$stmt = $db->prepare('DELETE FROM banned_usernames WHERE username = ?');
|
||||
$stmt->execute([$username]);
|
||||
$success = "Username $username has been preventively unbanned";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -121,6 +125,36 @@ $users = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h2>Preventively Banned Usernames</h2>
|
||||
<table class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Username</th>
|
||||
<th>Banned At</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$stmt = $db->query('SELECT username, created_at FROM banned_usernames ORDER BY created_at DESC');
|
||||
$banned_usernames = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
foreach ($banned_usernames as $banned): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($banned['username']) ?></td>
|
||||
<td><?= $banned['created_at'] ?></td>
|
||||
<td>
|
||||
<form method="post" style="display:inline">
|
||||
<input type="hidden" name="username" value="<?= htmlspecialchars($banned['username']) ?>">
|
||||
<input type="hidden" name="action" value="preventive_unban">
|
||||
<button type="submit" class="unban-btn">Unban</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2>Users</h2>
|
||||
<table class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user