This commit is contained in:
@@ -3,6 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App;
|
||||
|
||||
use App\Avatar\AvatarManager;
|
||||
use App\Avatar\Lorelei;
|
||||
|
||||
final class AccountPages
|
||||
@@ -340,6 +341,9 @@ final class AccountPages
|
||||
'email' => '',
|
||||
'contact_phone' => '',
|
||||
'location_tracking_preference' => 'prompt',
|
||||
'avatar_style' => AvatarManager::defaultStyle(),
|
||||
'avatar_seed' => '',
|
||||
'avatar_config_json' => '',
|
||||
'avatar_preset' => 'papa-kind-treff',
|
||||
'avatar_lorelei_eyes_variant' => '',
|
||||
'avatar_lorelei_eyebrows_variant' => '',
|
||||
@@ -352,7 +356,11 @@ final class AccountPages
|
||||
if ($profileSettings) {
|
||||
$profileSettings->ensureSchema();
|
||||
}
|
||||
$stmt = $pdo?->prepare('SELECT u.email, u.status, p.display_name, p.first_name, p.last_name, p.zip, p.city, p.profession, p.languages, p.about, p.contact_phone, p.location_tracking_preference, p.avatar_preset, p.avatar_lorelei_eyes_variant, p.avatar_lorelei_eyebrows_variant, p.avatar_lorelei_mouth_variant, p.avatar_lorelei_glasses_variant, p.avatar_lorelei_hair_variant, p.avatar_lorelei_beard_variant, p.avatar_lorelei_earrings_variant FROM users u LEFT JOIN user_profiles p ON p.user_id = u.id WHERE u.id = :id LIMIT 1');
|
||||
$avatarColumns = implode(', ', array_map(
|
||||
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.zip, p.city, 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) {
|
||||
@@ -361,7 +369,7 @@ final class AccountPages
|
||||
$profile['contact_phone'] = $crypto->decrypt((string)$profile['contact_phone']) ?: '';
|
||||
}
|
||||
}
|
||||
$profile = array_merge($profile, Lorelei::normalize($profile));
|
||||
$profile = AvatarManager::normalizeProfile($profile, $userId);
|
||||
|
||||
$children = [];
|
||||
$stmt = $pdo?->prepare('SELECT id, encrypted_first_name AS first_name, note, gender, birthdate, age_years FROM children WHERE user_id = :id ORDER BY id DESC');
|
||||
@@ -418,7 +426,7 @@ final class AccountPages
|
||||
if (!in_array($section, $allowedSections, true)) {
|
||||
$section = 'profile';
|
||||
}
|
||||
$avatarOptions = Lorelei::options();
|
||||
$avatarBuilder = AvatarManager::builderStyles($profile);
|
||||
|
||||
return compact(
|
||||
'flash',
|
||||
@@ -435,7 +443,7 @@ final class AccountPages
|
||||
'communityApplication',
|
||||
'communityCanApply',
|
||||
'communityRestrictions',
|
||||
'avatarOptions',
|
||||
'avatarBuilder',
|
||||
'section',
|
||||
'allowedSections'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user