1,"name"=>"Teste","email"=>"teste@fitme3070.pt","role"=>"client"]; $_SESSION["user_id"] = 1; $_SESSION["user"] = $user; // require_login(); // Editable per-tenant fields only. Name/email are owned by Andmore ID and synced // on login by sso_resolve_session(); the password is managed centrally. $saved = false; if ($_SERVER['REQUEST_METHOD'] === 'POST') { csrf_check(); $phone = trim($_POST['phone'] ?? ''); $address = trim($_POST['address'] ?? ''); $city = trim($_POST['city'] ?? ''); $postal_code = trim($_POST['postal_code'] ?? ''); $email_opt = isset($_POST['email_opt_out']) ? 1 : 0; $sms_opt = isset($_POST['sms_opt_out']) ? 1 : 0; $marketing = isset($_POST['marketing_consent']) ? 1 : 0; $pdo->prepare( "UPDATE users SET phone=?, address=?, city=?, postal_code=?, email_opt_out=?, sms_opt_out=?, marketing_consent=? WHERE id=?" )->execute([$phone, $address, $city, $postal_code, $email_opt, $sms_opt, $marketing, $user['id']]); $saved = true; } $row = db_get_user($pdo, (int) $user['id']) ?? []; include __DIR__ . '/../../includes/header.php'; ?>
Nome, email e palavra-passe são geridos no Andmore ID. Gerir conta →