feat: auto-refresh AJAX, bouton transfert entre comptes, webhook par compte
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,9 +29,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) {
|
||||
if ($st->fetch()) {
|
||||
$error = "Le compte « {$username} » existe déjà.";
|
||||
} else {
|
||||
$webhook = trim($_POST['webhook_url'] ?? '');
|
||||
db()->prepare(
|
||||
'INSERT INTO accounts (username, email, display_name, smb_path) VALUES (?, ?, ?, ?)'
|
||||
)->execute([$username, $email, $display, $smbPath]);
|
||||
'INSERT INTO accounts (username, email, display_name, smb_path, webhook_url) VALUES (?, ?, ?, ?, ?)'
|
||||
)->execute([$username, $email, $display, $smbPath, $webhook ?: null]);
|
||||
|
||||
// Crée le dossier, l'utilisateur Dovecot et le share Samba
|
||||
$cmd = sprintf(
|
||||
@@ -114,6 +115,11 @@ html_navbar('accounts');
|
||||
<label class="form-label">Nom affiché <span class="text-muted">(optionnel)</span></label>
|
||||
<input type="text" name="display_name" class="form-control" placeholder="Copy Caisse">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Webhook URL <span class="text-muted">(optionnel)</span></label>
|
||||
<input type="url" name="webhook_url" class="form-control" placeholder="https://…/webhook">
|
||||
<div class="form-text">POST JSON à chaque réception de mail.</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary w-100">
|
||||
<i class="bi bi-plus-circle me-1"></i>Créer le compte
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user