diff --git a/lib/Froxlor/Install/Install.php b/lib/Froxlor/Install/Install.php index 520037f6..b982b25c 100644 --- a/lib/Froxlor/Install/Install.php +++ b/lib/Froxlor/Install/Install.php @@ -42,9 +42,15 @@ class Install public array $suggestions = []; public array $criticals = []; public array $loadedExtensions; + // TODO: add more os public array $supportedOS = [ 'focal' => 'Ubuntu 20.04 LTS (Focal Fossa)' ]; + public array $webserverBackend = [ + 'php-fpm' => 'PHP-FPM', + 'fcgid' => 'FCGID', + 'none' => 'None', + ]; public function __construct() { @@ -126,7 +132,7 @@ class Install // also handle completion of installation if it's the step before the last step if ($this->currentStep == ($this->maxSteps -1)) { - $core = new \Froxlor\Install\Install\Core($_SESSION['installation']); + $core = new Core($_SESSION['installation']); $core->doInstall(); } diff --git a/lib/Froxlor/Install/Install/Core.php b/lib/Froxlor/Install/Install/Core.php index 33d57dee..636d2722 100644 --- a/lib/Froxlor/Install/Install/Core.php +++ b/lib/Froxlor/Install/Install/Core.php @@ -30,6 +30,7 @@ use Froxlor\Config\ConfigParser; use Froxlor\FileDir; use Froxlor\Froxlor; use Froxlor\PhpHelper; +use Froxlor\System\Crypt; use PDO; use PDOException; use PDOStatement; @@ -503,9 +504,8 @@ class Core // last but not least create the main admin $ins_data = [ 'loginname' => $this->validatedData['admin_user'], - /* use system default crypt */ 'password' => password_hash($this->validatedData['admin_pass'], PASSWORD_DEFAULT), - 'email' => 'admin@' . $this->validatedData['servername'], + 'email' => $this->validatedData['admin_email'], 'deflang' => 'en' // TODO: set lanuage ]; $ins_stmt = $db_user->prepare(" diff --git a/lib/formfields/install/formfield.install.php b/lib/formfields/install/formfield.install.php index f0e39d8f..82d93f0a 100644 --- a/lib/formfields/install/formfield.install.php +++ b/lib/formfields/install/formfield.install.php @@ -121,6 +121,7 @@ return [ 'distribution' => [ 'label' => lng('distribution'), 'type' => 'select', + 'mandatory' => true, 'select_var' => $this->supportedOS, ], 'serverip' => [ @@ -139,7 +140,7 @@ return [ 'label' => lng('use_ssl'), 'type' => 'checkbox', 'value' => '1', - 'checked' => old('use_ssl', '0', 'installation'), + 'checked' => old('use_ssl', '1', 'installation'), ], 'webserver' => [ 'label' => lng('webserver'), @@ -147,6 +148,12 @@ return [ 'mandatory' => true, 'value' => old('webserver', 'apache24', 'installation'), ], + 'webserver_backend' => [ + 'label' => lng('webserver_backend'), + 'type' => 'select', + 'mandatory' => true, + 'select_var' => $this->webserverBackend, + ], 'httpuser' => [ 'label' => lng('httpuser'), 'type' => 'text',