csadas
All checks were successful
Deploy / deploy (push) Successful in 58s

This commit is contained in:
2026-07-31 21:45:19 +02:00
parent 002108ac83
commit c335fd6f5c
6 changed files with 158 additions and 88 deletions

View File

@@ -182,10 +182,14 @@ final class AccountPages
try {
if ($action === 'profile') {
$crypto = self::requireCrypto($crypto, 'Profil');
$email = trim((string)($_POST['email'] ?? ''));
$languages = $_POST['languages'] ?? '';
if (is_array($languages)) {
$languages = implode(', ', array_map('trim', $languages));
}
if ($email === '' || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
throw new \RuntimeException('Bitte gib eine gueltige E-Mail-Adresse an.');
}
$firstNameEnc = self::encryptOptionalProfileField($crypto, trim((string)$_POST['first_name']));
$lastNameEnc = self::encryptOptionalProfileField($crypto, trim((string)$_POST['last_name']));
$streetEnc = self::encryptOptionalProfileField($crypto, trim((string)($_POST['street'] ?? '')));
@@ -249,6 +253,11 @@ final class AccountPages
'locationPref' => in_array($locationPreference, ['disabled', 'prompt', 'enabled'], true) ? $locationPreference : 'prompt',
'id' => $userId,
]);
if ($pdo) {
$emailStore = new UserEmailStore($pdo);
$emailStore->ensureSchema();
$emailStore->updateUserEmail($userId, $email);
}
$info = 'Profil gespeichert.';
} elseif ($action === 'avatar_update') {
if ($profileSettings) {