updated other pages

This commit is contained in:
Lain Iwakura 2025-06-16 03:28:46 +03:00
parent f58c1fa2da
commit 253c4a48cb
No known key found for this signature in database
GPG Key ID: C7C18257F2ADC6F8
3 changed files with 377 additions and 117 deletions

View File

@ -60,6 +60,8 @@ $users = $stmt->fetchAll(PDO::FETCH_ASSOC);
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline';">
<title>Text0Nly - Admin Panel</title> <title>Text0Nly - Admin Panel</title>
<link rel="stylesheet" href="styles.css"> <link rel="stylesheet" href="styles.css">
<style> <style>
@ -67,36 +69,102 @@ $users = $stmt->fetchAll(PDO::FETCH_ASSOC);
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
margin-top: 20px; margin-top: 20px;
font-size: 14px;
} }
.admin-table th, .admin-table td { .admin-table th, .admin-table td {
padding: 8px; padding: 12px 8px;
border: 1px solid #ddd; border: 1px solid #ddd;
text-align: left; text-align: left;
} }
.admin-table th { .admin-table th {
background: #f5f5f5; background: #f5f5f5;
font-weight: 600;
} }
.ban-btn { .ban-btn {
background: #dc3545; background: #dc3545;
color: white; color: white;
border: none; border: none;
padding: 4px 8px; padding: 8px 12px;
cursor: pointer; cursor: pointer;
border-radius: 4px; border-radius: 4px;
font-size: 14px;
width: 100%;
} }
.unban-btn { .unban-btn {
background: #28a745; background: #28a745;
color: white; color: white;
border: none; border: none;
padding: 4px 8px; padding: 8px 12px;
cursor: pointer; cursor: pointer;
border-radius: 4px; border-radius: 4px;
font-size: 14px;
width: 100%;
} }
.status-banned { .status-banned {
color: #dc3545; color: #dc3545;
font-weight: 600;
} }
.status-moderator { .status-moderator {
color: #28a745; color: #28a745;
font-weight: 600;
}
.preventive-ban {
background: #fff;
padding: 15px;
border-radius: 8px;
margin: 20px 0;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.ban-form {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.ban-form input[type="text"] {
flex: 1;
min-width: 200px;
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 16px;
}
.ban-form button {
padding: 8px 16px;
}
.error {
color: #dc3545;
background: #fff;
padding: 10px;
border-radius: 4px;
margin: 10px 0;
border: 1px solid #dc3545;
}
.success {
color: #28a745;
background: #fff;
padding: 10px;
border-radius: 4px;
margin: 10px 0;
border: 1px solid #28a745;
}
@media (max-width: 600px) {
.admin-table {
display: block;
overflow-x: auto;
white-space: nowrap;
}
.ban-form {
flex-direction: column;
}
.ban-form input[type="text"] {
width: 100%;
}
.ban-form button {
width: 100%;
}
.admin-table th, .admin-table td {
padding: 8px;
}
} }
</style> </style>
</head> </head>
@ -126,6 +194,7 @@ $users = $stmt->fetchAll(PDO::FETCH_ASSOC);
</div> </div>
<h2>Preventively Banned Usernames</h2> <h2>Preventively Banned Usernames</h2>
<div style="overflow-x: auto;">
<table class="admin-table"> <table class="admin-table">
<thead> <thead>
<tr> <tr>
@ -153,8 +222,10 @@ $users = $stmt->fetchAll(PDO::FETCH_ASSOC);
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
</div>
<h2>Users</h2> <h2>Users</h2>
<div style="overflow-x: auto;">
<table class="admin-table"> <table class="admin-table">
<thead> <thead>
<tr> <tr>
@ -197,5 +268,6 @@ $users = $stmt->fetchAll(PDO::FETCH_ASSOC);
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
</body> </body>
</html> </html>

View File

@ -66,17 +66,103 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline';">
<title>Text0Nly - Login</title> <title>Text0Nly - Login</title>
<style> <style>
body { font-family: Arial, sans-serif; max-width: 400px; margin: 20px auto; padding: 20px; } body {
.form-group { margin: 10px 0; } font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
input { width: 100%; padding: 8px; margin: 5px 0; } margin: 0;
button { width: 100%; padding: 10px; background: #2196F3; color: white; border: none; cursor: pointer; } padding: 20px;
.error { color: red; } min-height: 100vh;
.success { color: green; } display: flex;
flex-direction: column;
align-items: center;
background: #f8f9fa;
}
.container {
width: 100%;
max-width: 400px;
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
margin-top: 20px;
}
h2 {
margin: 0 0 20px 0;
text-align: center;
color: #222;
}
.form-group {
margin: 15px 0;
}
input {
width: 100%;
padding: 12px;
margin: 5px 0;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
font-size: 16px;
}
button {
width: 100%;
padding: 12px;
background: #222;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
margin-top: 10px;
}
button:hover {
background: #444;
}
.error {
color: #dc3545;
background: #fff;
padding: 10px;
border-radius: 4px;
margin-bottom: 15px;
border: 1px solid #dc3545;
}
.success {
color: #28a745;
background: #fff;
padding: 10px;
border-radius: 4px;
margin-bottom: 15px;
border: 1px solid #28a745;
}
.links {
text-align: center;
margin-top: 20px;
}
.links a {
color: #222;
text-decoration: none;
margin: 0 10px;
}
.links a:hover {
text-decoration: underline;
}
@media (max-width: 400px) {
body {
padding: 10px;
}
.container {
padding: 15px;
}
h2 {
font-size: 1.5em;
}
}
</style> </style>
</head> </head>
<body> <body>
<div class="container">
<h2>Login</h2> <h2>Login</h2>
<?php if ($error): ?> <?php if ($error): ?>
<div class="error"><?= htmlspecialchars($error) ?></div> <div class="error"><?= htmlspecialchars($error) ?></div>
@ -85,16 +171,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<div class="success"><?= htmlspecialchars($success) ?></div> <div class="success"><?= htmlspecialchars($success) ?></div>
<?php endif; ?> <?php endif; ?>
<form method="post"> <form method="post" autocomplete="off">
<div class="form-group"> <div class="form-group">
<input type="text" name="username" placeholder="Username" required> <input type="text" name="username" placeholder="Username" required autocomplete="username">
</div> </div>
<div class="form-group"> <div class="form-group">
<input type="password" name="password" placeholder="Password" required> <input type="password" name="password" placeholder="Password" required autocomplete="current-password">
</div> </div>
<button type="submit">Login</button> <button type="submit">Login</button>
</form> </form>
<p><a href="register.php">Register</a> | <a href="index.php">Back to chat</a></p> <div class="links">
<a href="register.php">Register</a>
<a href="index.php">Back to chat</a>
</div>
</div>
</body> </body>
</html> </html>
<?php ob_end_flush(); ?> <?php ob_end_flush(); ?>

View File

@ -68,18 +68,111 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline';">
<title>Text0Nly - Registration</title> <title>Text0Nly - Registration</title>
<style> <style>
body { font-family: Arial, sans-serif; max-width: 400px; margin: 20px auto; padding: 20px; } body {
.form-group { margin: 10px 0; } font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
input, textarea { width: 100%; padding: 8px; margin: 5px 0; } margin: 0;
textarea { height: 100px; } padding: 20px;
button { width: 100%; padding: 10px; background: #2196F3; color: white; border: none; cursor: pointer; } min-height: 100vh;
.error { color: red; } display: flex;
.success { color: green; } flex-direction: column;
align-items: center;
background: #f8f9fa;
}
.container {
width: 100%;
max-width: 400px;
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
margin-top: 20px;
}
h2 {
margin: 0 0 20px 0;
text-align: center;
color: #222;
}
.form-group {
margin: 15px 0;
}
input, textarea {
width: 100%;
padding: 12px;
margin: 5px 0;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
font-size: 16px;
}
textarea {
height: 120px;
resize: vertical;
}
button {
width: 100%;
padding: 12px;
background: #222;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
margin-top: 10px;
}
button:hover {
background: #444;
}
.error {
color: #dc3545;
background: #fff;
padding: 10px;
border-radius: 4px;
margin-bottom: 15px;
border: 1px solid #dc3545;
}
.success {
color: #28a745;
background: #fff;
padding: 10px;
border-radius: 4px;
margin-bottom: 15px;
border: 1px solid #28a745;
}
.links {
text-align: center;
margin-top: 20px;
}
.links a {
color: #222;
text-decoration: none;
}
.links a:hover {
text-decoration: underline;
}
.requirements {
font-size: 0.9em;
color: #666;
margin: 5px 0;
}
@media (max-width: 400px) {
body {
padding: 10px;
}
.container {
padding: 15px;
}
h2 {
font-size: 1.5em;
}
}
</style> </style>
</head> </head>
<body> <body>
<div class="container">
<h2>Registration</h2> <h2>Registration</h2>
<?php if ($error): ?> <?php if ($error): ?>
<div class="error"><?= htmlspecialchars($error) ?></div> <div class="error"><?= htmlspecialchars($error) ?></div>
@ -88,19 +181,24 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<div class="success"><?= htmlspecialchars($success) ?></div> <div class="success"><?= htmlspecialchars($success) ?></div>
<?php endif; ?> <?php endif; ?>
<form method="post"> <form method="post" autocomplete="off">
<div class="form-group"> <div class="form-group">
<input type="text" name="username" placeholder="Username" required maxlength="50"> <input type="text" name="username" placeholder="Username" required maxlength="50" pattern="[a-zA-Z0-9_]+" autocomplete="username">
<div class="requirements">Only letters, numbers and underscore allowed</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<input type="password" name="password" placeholder="Password (min 8 characters)" required minlength="8"> <input type="password" name="password" placeholder="Password" required minlength="8" autocomplete="new-password">
<div class="requirements">Minimum 8 characters</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<textarea name="pgp_key" placeholder="PGP key (optional)"></textarea> <textarea name="pgp_key" placeholder="PGP key (optional)" maxlength="4096"></textarea>
</div> </div>
<button type="submit">Register</button> <button type="submit">Register</button>
</form> </form>
<p><a href="index.php">Back to chat</a></p> <div class="links">
<a href="index.php">Back to chat</a>
</div>
</div>
</body> </body>
</html> </html>
<?php ob_end_flush(); ?> <?php ob_end_flush(); ?>