mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
Add admin account page for PHP password management
Implements the admin user management UI as a self-contained PHP password change/set flow — no SSH or sudo required. - public/admin/account.php: shows auth status (PHP hash present, credentials file path), password change form (requires current password when one exists, min 12 chars, confirm field), and a danger-zone form to delete the credentials file entirely - public/admin/actions/account.php: CSRF-guarded POST handler; verifies current password via AdminAuth::login() before accepting a new one; generates bcrypt (cost 12) hash; writes config/admin_credentials.php atomically via a temp file + rename; regenerates session on success; redirects to /admin/login.php when credentials are deleted - templates/admin/head.php: 'Compte' nav link added (active on account.php) - public/assets/admin.css: .admin-account-status, .admin-section-title, .admin-field-hint, .admin-danger-zone component styles added Note: the nginx htpasswd flow (manage-admin-users.sh) requires root on the server and is intentionally kept as a CLI-only operation.
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
<a href="/admin/tags.php" class="admin-nav__link <?= $currentPage === 'tags.php' ? 'active' : '' ?>">Mots-clés</a>
|
||||
<a href="/admin/status.php" class="admin-nav__link <?= $currentPage === 'status.php' ? 'active' : '' ?>">Statut</a>
|
||||
<a href="/admin/logs.php" class="admin-nav__link <?= $currentPage === 'logs.php' ? 'active' : '' ?>">Journaux</a>
|
||||
<a href="/admin/account.php" class="admin-nav__link <?= $currentPage === 'account.php' ? 'active' : '' ?>">Compte</a>
|
||||
<?php if ($thesisId && in_array($currentPage, ['edit.php', 'thanks.php'])): ?>
|
||||
<a href="/admin/edit.php?id=<?= intval($thesisId) ?>" class="admin-nav__link <?= $currentPage === 'edit.php' ? 'active' : '' ?>">Modifier</a>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user