This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user