This commit is contained in:
@@ -104,7 +104,6 @@ final class AccountPages
|
||||
|
||||
public static function verify(App $app): array
|
||||
{
|
||||
$pdo = $app->pdo();
|
||||
$flash = $app->flash()->get();
|
||||
$error = '';
|
||||
$info = '';
|
||||
@@ -119,20 +118,19 @@ final class AccountPages
|
||||
|
||||
if ($action === 'resend') {
|
||||
try {
|
||||
$stmt = $pdo?->prepare('SELECT id, display_name, status FROM users u JOIN user_profiles p ON p.user_id = u.id WHERE u.email = :email LIMIT 1');
|
||||
$stmt?->execute(['email' => $email]);
|
||||
$row = $stmt?->fetch(\PDO::FETCH_ASSOC);
|
||||
$row = $auth->findUserMetaByEmail($email);
|
||||
if (!$row) {
|
||||
throw new \RuntimeException('E-Mail nicht gefunden.');
|
||||
}
|
||||
$userId = (int)$row['id'];
|
||||
$codeNew = $auth->createVerifyCode($userId, $email);
|
||||
$mailer->sendTemplate('registration_resend_code', $email, [
|
||||
$storedEmail = $auth->getEmailByUserId($userId);
|
||||
$codeNew = $auth->createVerifyCode($userId, $storedEmail);
|
||||
$mailer->sendTemplate('registration_resend_code', $storedEmail, [
|
||||
'code' => $codeNew,
|
||||
'display_name' => $row['display_name'] ?? '',
|
||||
]);
|
||||
$info = 'Neuer Code wurde versendet.';
|
||||
$_SESSION['verify_email'] = $email;
|
||||
$_SESSION['verify_email'] = $storedEmail;
|
||||
} catch (\Throwable $e) {
|
||||
$error = $e->getMessage();
|
||||
}
|
||||
@@ -141,7 +139,11 @@ final class AccountPages
|
||||
$userId = $auth->verifyCode($email, $code);
|
||||
$_SESSION['user_id'] = $userId;
|
||||
unset($_SESSION['verify_email']);
|
||||
$mailer->sendTemplate('registration_welcome', $email, ['display_name' => $email]);
|
||||
$storedEmail = $auth->getEmailByUserId($userId);
|
||||
$meta = $auth->findUserMetaByEmail($storedEmail);
|
||||
$mailer->sendTemplate('registration_welcome', $storedEmail, [
|
||||
'display_name' => $meta['display_name'] ?? $storedEmail,
|
||||
]);
|
||||
$app->flash()->set('success', 'Registrierung bestätigt. Willkommen!');
|
||||
redirect('/dashboard');
|
||||
} catch (\Throwable $e) {
|
||||
@@ -471,7 +473,7 @@ final class AccountPages
|
||||
static fn(string $column): string => 'p.' . $column,
|
||||
AvatarManager::allProfileColumns()
|
||||
));
|
||||
$stmt = $pdo?->prepare("SELECT u.email, u.status, p.display_name, p.first_name, p.last_name, p.street, p.zip, p.city, p.region, p.lat, p.lng, p.profession, p.languages, p.about, p.contact_phone, p.location_tracking_preference, $avatarColumns FROM users u LEFT JOIN user_profiles p ON p.user_id = u.id WHERE u.id = :id LIMIT 1");
|
||||
$stmt = $pdo?->prepare("SELECT u.status, p.display_name, p.first_name, p.last_name, p.street, p.zip, p.city, p.region, p.lat, p.lng, p.profession, p.languages, p.about, p.contact_phone, p.location_tracking_preference, $avatarColumns FROM users u LEFT JOIN user_profiles p ON p.user_id = u.id WHERE u.id = :id LIMIT 1");
|
||||
$stmt?->execute(['id' => $userId]);
|
||||
$row = $stmt?->fetch(\PDO::FETCH_ASSOC);
|
||||
if ($row) {
|
||||
@@ -488,6 +490,7 @@ final class AccountPages
|
||||
);
|
||||
}
|
||||
}
|
||||
$profile['email'] = (new Auth($app))->getEmailByUserId($userId);
|
||||
$profile = AvatarManager::normalizeProfile($profile, $userId);
|
||||
|
||||
$editChildId = isset($_GET['edit_child']) ? (int)$_GET['edit_child'] : 0;
|
||||
|
||||
Reference in New Issue
Block a user