implemented step 11
- sections on website
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user