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>
31 lines
832 B
PHP
31 lines
832 B
PHP
<?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]);
|