avatar
All checks were successful
Deploy / deploy (push) Successful in 1m5s

This commit is contained in:
2026-07-24 21:28:35 +02:00
parent 5630ff2308
commit 9a5f1b1a5d
41 changed files with 231 additions and 203 deletions

View File

@@ -29,6 +29,7 @@ final class ProfileSettings
}
$avatarColumns = [
'avatar_preset' => "ALTER TABLE user_profiles ADD COLUMN avatar_preset VARCHAR(32) NOT NULL DEFAULT 'modern_01' AFTER location_tracking_preference",
'avatar_skin_tone' => "ALTER TABLE user_profiles ADD COLUMN avatar_skin_tone VARCHAR(24) NOT NULL DEFAULT 'warm' AFTER location_tracking_preference",
'avatar_hair_style' => "ALTER TABLE user_profiles ADD COLUMN avatar_hair_style VARCHAR(24) NOT NULL DEFAULT 'short' AFTER avatar_skin_tone",
'avatar_hair_color' => "ALTER TABLE user_profiles ADD COLUMN avatar_hair_color VARCHAR(24) NOT NULL DEFAULT 'brown' AFTER avatar_hair_style",
@@ -85,6 +86,23 @@ final class ProfileSettings
}
$this->ensureSchema();
$preset = (string)($avatarConfig['avatar_preset'] ?? '');
if ($preset !== '') {
$options = Avatar::presetOptions();
$preset = array_key_exists($preset, $options) ? $preset : 'modern_01';
$stmt = $this->pdo->prepare(
'UPDATE user_profiles
SET avatar_preset = :preset,
updated_at = NOW()
WHERE user_id = :id'
);
$stmt->execute([
'preset' => $preset,
'id' => $userId,
]);
return;
}
$avatar = Avatar::normalize($avatarConfig);
$stmt = $this->pdo->prepare(
'UPDATE user_profiles