smtp and viewr password moved to generated config.php

This commit is contained in:
2026-06-15 04:55:34 +02:00
parent 269cc5f5d5
commit 4135b621c4
3 changed files with 9 additions and 7 deletions

View File

@ -89,16 +89,18 @@ class Renderer
// Copy handler
copy($this->templatesPath . '/emailer.php', $projectExportDir . '/ajax.php');
// Create config for handler
// Create config for handler (PHP file is not web-accessible)
$siteConfig = [
'site_name' => $projectData['wizard_data']['identity']['business_name'],
'form_mode' => $formConfig['mode'] ?? 'local',
'smtp' => $formConfig['smtp'] ?? null,
'local_password_hash' => $formConfig['local_viewer']['password_hash'] ?? null
];
file_put_contents($projectExportDir . '/config.json', json_encode($siteConfig, JSON_PRETTY_PRINT));
$configContent = "<?php\nreturn " . var_export($siteConfig, true) . ";\n";
file_put_contents($projectExportDir . '/config.php', $configContent);
if ($siteConfig['form_mode'] === 'local') {
if (($siteConfig['form_mode'] ?? 'local') === 'local') {
// Copy viewer
copy($this->templatesPath . '/form-viewer.php', $projectExportDir . '/form-viewer.php');
// Create messages dir