Added the email for the owner and changed the admin123 for the login page
This commit is contained in:
@@ -30,6 +30,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
} elseif ($action === 'upload_favicon' && is_owner()) {
|
||||
$res = upload_site_favicon($_FILES['favicon_file'] ?? null);
|
||||
if ($res['success']) $msg_success = $res['message']; else $msg_error = $res['message'];
|
||||
} elseif ($action === 'update_admin_email' && is_owner()) {
|
||||
$new_email = trim($_POST['admin_email'] ?? '');
|
||||
if (!empty($new_email) && filter_var($new_email, FILTER_VALIDATE_EMAIL)) {
|
||||
update_site_setting('admin_email', $new_email);
|
||||
$msg_success = "Email dell'amministratore di sistema aggiornata con successo!";
|
||||
} else {
|
||||
$msg_error = "Inserisci un indirizzo email valido per l'amministratore di sistema.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +56,7 @@ foreach ($all_blocknotes as $bn) {
|
||||
|
||||
$site_title = get_site_setting('site_title', 'sld-blocknotes');
|
||||
$site_favicon = get_site_setting('site_favicon', 'assets/img/favicon.png');
|
||||
$admin_email = get_site_setting('admin_email', '[email protected]');
|
||||
?>
|
||||
|
||||
<main class="main-content">
|
||||
@@ -96,6 +105,18 @@ $site_favicon = get_site_setting('site_favicon', 'assets/img/favicon.png');
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- Modifica Email Amministratore -->
|
||||
<form action="index.php?page=admin_users" method="POST">
|
||||
<input type="hidden" name="action" value="update_admin_email">
|
||||
<div class="form-group">
|
||||
<label for="admin_email"><?= __('label_admin_email') ?></label>
|
||||
<input type="email" name="admin_email" id="admin_email" class="form-control" value="<?= htmlspecialchars($admin_email) ?>" required placeholder="<?= htmlspecialchars(__('placeholder_admin_email')) ?>">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" style="margin-top: 0.5rem;">
|
||||
<?= __('btn_save_admin_email') ?>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- Caricamento Favicon -->
|
||||
<form action="index.php?page=admin_users" method="POST" enctype="multipart/form-data">
|
||||
<input type="hidden" name="action" value="upload_favicon">
|
||||
|
||||
+9
-4
@@ -62,10 +62,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div style="margin-top: 1.5rem; text-align: center; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.82rem; color: #64748b;">
|
||||
<?= __('login_hint_footer') ?>:<br>
|
||||
<strong style="color: #94a3b8;"><?= __('label_username') ?>:</strong> admin | <strong style="color: #94a3b8;"><?= __('label_password') ?>:</strong> admin123
|
||||
</div>
|
||||
<?php $admin_email = get_site_setting('admin_email', '[email protected]'); ?>
|
||||
<?php if (!empty($admin_email)): ?>
|
||||
<div style="margin-top: 1.5rem; text-align: center; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.85rem; color: #94a3b8;">
|
||||
<?= __('login_request_account') ?><br>
|
||||
<a href="mailto:<?= htmlspecialchars($admin_email) ?>" style="color: #7dd3fc; font-weight: 600; text-decoration: underline; margin-top: 0.35rem; display: inline-block;">
|
||||
✉️ <?= htmlspecialchars($admin_email) ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user