Public web-only release: SvxPortal front-end + auth backend, install templates and INSTALL.md
Stripped from the internal repo: per-box deploy trees, Go services (nodelist/astmeta/proxy/svxdr), deploy/sync scripts and all secrets. Config templates for nginx, PHP-FPM, Redis and tmpfiles live in install/ with CHANGEME placeholders. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
require __DIR__ . '/lib.php';
|
||||
|
||||
$uuid = require_login();
|
||||
csrf_check();
|
||||
$j = json_in();
|
||||
|
||||
$allowed = ['firstname','lastname','shortname','email','city','state','country'];
|
||||
$updates = [];
|
||||
foreach ($allowed as $f) {
|
||||
if (isset($j[$f]) && is_string($j[$f])) $updates[$f] = trim($j[$f]);
|
||||
}
|
||||
|
||||
if (empty($updates)) json_out(['ok'=>false,'error'=>'no_fields'], 400);
|
||||
|
||||
// Email-uppdatering kräver index-update
|
||||
if (isset($updates['email'])) {
|
||||
$old = acct_get($uuid);
|
||||
$old_em = strtolower(trim($old['email'] ?? ''));
|
||||
$new_em = norm_email($updates['email']);
|
||||
$updates['email'] = $new_em;
|
||||
if ($old_em !== $new_em) {
|
||||
if ($old_em !== '') redis()->del(email_index_key($old_em));
|
||||
redis()->set(email_index_key($new_em), $uuid);
|
||||
}
|
||||
}
|
||||
|
||||
redis()->hMSet(acct_key($uuid), $updates);
|
||||
json_out(['ok'=>true]);
|
||||
Reference in New Issue
Block a user