implemented step 11

- sections on website
This commit is contained in:
2026-06-14 09:06:03 +02:00
parent c11f7e4d75
commit c01eb30632
4 changed files with 260 additions and 6 deletions

View File

@ -171,6 +171,34 @@ class ProjectActions
$projectData['wizard_data']['visuals'] = $data['visuals'];
$projectData['wizard_data']['assets'] = $data['assets'];
break;
case 5:
if (!isset($data['modules'])) {
throw new Exception("Missing modules data.", 400);
}
$modules = $data['modules'];
// Secure local password if present
if ($modules['contact_form']['enabled'] && $modules['contact_form']['mode'] === 'local') {
if (!empty($modules['contact_form']['local_viewer']['password'])) {
$modules['contact_form']['local_viewer']['password_hash'] = password_hash(
$modules['contact_form']['local_viewer']['password'],
PASSWORD_DEFAULT
);
// Never store plain-text password
unset($modules['contact_form']['local_viewer']['password']);
} else {
// Keep existing hash if password not provided (updating other fields)
$oldHash = $projectData['wizard_data']['modules']['contact_form']['local_viewer']['password_hash'] ?? null;
if ($oldHash) {
$modules['contact_form']['local_viewer']['password_hash'] = $oldHash;
}
}
}
$projectData['wizard_data']['modules'] = $modules;
break;
// More steps will be added later
}