diff --git a/admin_configfiles.php b/admin_configfiles.php index 52b41651..6ca70336 100644 --- a/admin_configfiles.php +++ b/admin_configfiles.php @@ -20,6 +20,14 @@ require './lib/init.php'; if ($userinfo['change_serversettings'] == '1') { + if ($action == 'setconfigured') + { + Settings::Set('panel.is_configured', '1', true); + redirectTo('admin_configfiles.php', array( + 's' => $s + )); + } + $customer_tmpdir = '/tmp/'; if (Settings::Get('system.mod_fcgid') == '1' && Settings::Get('system.mod_fcgid_tmpdir') != '') { @@ -164,38 +172,38 @@ if ($userinfo['change_serversettings'] == '1') { $lasttype = ''; $commands = ''; - foreach ($confarr as $idx => $action) { - if ($lasttype != '' && $lasttype != $action['type']) { + foreach ($confarr as $_action) { + if ($lasttype != '' && $lasttype != $_action['type']) { $commands = trim($commands); $numbrows = count(explode("\n", $commands)); eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_commands") . "\";"); $lasttype = ''; $commands = ''; } - switch ($action['type']) { + switch ($_action['type']) { case "install": - $commands .= strtr($action['content'], $replace_arr) . "\n"; + $commands .= strtr($_action['content'], $replace_arr) . "\n"; $lasttype = "install"; break; case "command": - $commands .= strtr($action['content'], $replace_arr) . "\n"; + $commands .= strtr($_action['content'], $replace_arr) . "\n"; $lasttype = "command"; break; case "file": - if (array_key_exists('content', $action)) { - $commands_file = getFileContentContainer($action['content'], $replace_arr, $action['name'], $distro_editor); - } elseif (array_key_exists('subcommands', $action)) { - foreach ($action['subcommands'] as $fileaction) { + if (array_key_exists('content', $_action)) { + $commands_file = getFileContentContainer($_action['content'], $replace_arr, $_action['name'], $distro_editor); + } elseif (array_key_exists('subcommands', $_action)) { + foreach ($_action['subcommands'] as $fileaction) { if (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "pre") { $commands_pre .= $fileaction['content'] . "\n"; } elseif (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "post") { $commands_post .= $fileaction['content'] . "\n"; } elseif ($fileaction['type'] == 'file') { - $commands_file = getFileContentContainer($fileaction['content'], $replace_arr, $action['name'], $distro_editor); + $commands_file = getFileContentContainer($fileaction['content'], $replace_arr, $_action['name'], $distro_editor); } } } - $realname = $action['name']; + $realname = $_action['name']; $commands = trim($commands_pre); if ($commands != "") { $numbrows = count(explode("\n", $commands)); @@ -220,11 +228,13 @@ if ($userinfo['change_serversettings'] == '1') { } eval("echo \"" . getTemplate("configfiles/configfiles") . "\";"); } else { + $basedir = FROXLOR_INSTALL_DIR; eval("echo \"" . getTemplate("configfiles/wizard") . "\";"); } } else { - die('not allowed to see this page'); - // redirect or similar here + redirectTo('admin_index.php', array( + 's' => $s + )); } // helper functions diff --git a/install/froxlor.sql b/install/froxlor.sql index c861cbd4..73d29d75 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -693,8 +693,9 @@ opcache.interned_strings_buffer'), ('panel', 'password_special_char_required', '0'), ('panel', 'password_special_char', '!?<>§$%+#=@'), ('panel', 'customer_hide_options', ''), + ('panel', 'is_configured', '0'), ('panel', 'version', '0.10.0'), - ('panel', 'db_version', '201812010'); + ('panel', 'db_version', '201812100'); DROP TABLE IF EXISTS `panel_tasks`; diff --git a/install/scripts/config-services.php b/install/scripts/config-services.php index b2217ec7..1f91fe26 100755 --- a/install/scripts/config-services.php +++ b/install/scripts/config-services.php @@ -236,6 +236,10 @@ class Action $_daemons_config[$si][] = $sysservice; } } while (! empty($sysservice)); + // add 'cron' as fixed part (doesn't hurt if it exists) + if (!in_array('cron', $_daemons_config[$si])) { + $_daemons_config[$si][] = 'cron'; + } } else { // for all others -> only one value while (! array_key_exists($_daemons_config[$si], $daemons)) { @@ -249,6 +253,9 @@ class Action $output = CmdLineHandler::getInput("choose output-filename", "/tmp/froxlor-config-" . date('Ymd') . ".json"); file_put_contents($output, $daemons_config); CmdLineHandler::printsucc("Successfully generated service-configfile '" . $output . "'"); + echo PHP_EOL; + CmdLineHandler::printsucc("You can now apply this config running:" . PHP_EOL . "php " . __FILE__ . " --froxlor-dir=" . dirname(dirname(__DIR__)) . " --apply=" . $output); + echo PHP_EOL; } private function getCompleteDistroName($cparser) @@ -342,10 +349,11 @@ class Action } // run all cmds $confarr = $dd->getConfig(); - foreach ($confarr as $idx => $action) { + foreach ($confarr as $action) { switch ($action['type']) { case "install": CmdLineHandler::println("Installing required packages"); + $result = null; passthru(strtr($action['content'], $replace_arr), $result); if (strlen($result) > 1) { echo $result; @@ -375,6 +383,8 @@ class Action } } } + // set is_configured flag + Settings::Set('panel.is_configured', '1', true); // run cronjob at the end to ensure configs are all up to date exec('php ' . FROXLOR_INSTALL_DIR . '/scripts/froxlor_master_cronjob.php --force'); // and done diff --git a/install/updates/froxlor/0.10/update_0.10.inc.php b/install/updates/froxlor/0.10/update_0.10.inc.php index 6efcb115..4124a8d2 100644 --- a/install/updates/froxlor/0.10/update_0.10.inc.php +++ b/install/updates/froxlor/0.10/update_0.10.inc.php @@ -105,3 +105,14 @@ if (isDatabaseVersion('201811300')) { updateToDbVersion('201812010'); } + +if (isDatabaseVersion('201812010')) { + + showUpdateStep("Adding new is_configured-flag"); + // updated systems are already configured (most likely :P) + Settings::AddNew('panel.is_configured', '1', true); + lastStepStatus(0); + + updateToDbVersion('201812100'); +} + diff --git a/lib/version.inc.php b/lib/version.inc.php index 142c0422..f8234062 100644 --- a/lib/version.inc.php +++ b/lib/version.inc.php @@ -19,7 +19,7 @@ $version = '0.10.0'; // Database version (YYYYMMDDC where C is a daily counter) -$dbversion = '201812010'; +$dbversion = '201812100'; // Distribution branding-tag (used for Debian etc.) $branding = ''; diff --git a/lng/english.lng.php b/lng/english.lng.php index eb9d15fb..18aad6a1 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -2167,3 +2167,9 @@ $lng['2fa']['2fa_email_desc'] = 'Your account is set up to use one-time password $lng['2fa']['2fa_ga_desc'] = 'Your account is set up to use time-based one-time passwords via authenticator-app. Please scan the QR code below with your desired authenticator app to generate the codes. To deactivate, click on "'.$lng['2fa']['2fa_delete'].'"'; $lng['admin']['logviewenabled'] = 'Enable access to access/error-logs'; $lng['panel']['viewlogs'] = 'View logfiles'; +$lng['panel']['not_configured'] = 'System not configured yet. Click here to go to configurations.'; +$lng['panel']['done_configuring'] = 'When you are done configuring all required / desired services,
click the link below'; +$lng['panel']['ihave_configured'] = 'I have configured the services'; +$lng['panel']['system_is_configured'] = 'System is already set as configured'; +$lng['panel']['settings_before_configuration'] = 'Please be sure you adjusted the settings prior to configuring the services here'; +$lng['panel']['alternative_cmdline_config'] = 'Alternatively, just run the following command as root-user in you shell to configure the services automatically'; diff --git a/lng/german.lng.php b/lng/german.lng.php index 6a5d957d..0cda1bea 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1815,3 +1815,9 @@ $lng['2fa']['2fa_email_desc'] = 'Das Konto ist eingerichtet, um Einmalpasswörte $lng['2fa']['2fa_ga_desc'] = 'Das Konto ist eingerichtet, um zeitbasierte Einmalpasswörter via Authenticator-App zu erhalten. Um die gewünschte Authenticator-App einzurichten, scanne bitte den untenstehenden QR-Code. Zum Deaktivieren, klicke auf "'.$lng['2fa']['2fa_delete'].'"'; $lng['admin']['logviewenabled'] = 'Zugriff auf access/error-Logdateien'; $lng['panel']['viewlogs'] = 'Logdateien einsehen'; +$lng['panel']['not_configured'] = 'Das System wurde noch nicht konfiguriert. Hier klicken für Konfiguration.'; +$lng['panel']['done_configuring'] = 'Nach Abschluss der Konfiguration der Dienste,
untenstehenden Link klicken'; +$lng['panel']['ihave_configured'] = 'Ich habe die Dienste konfiguriert'; +$lng['panel']['system_is_configured'] = 'Das System ist bereits konfiguriert'; +$lng['panel']['settings_before_configuration'] = 'Stelle sicher, dass die Einstellungen angepasst wurden bevor die Dienste konfiguriert werden.'; +$lng['panel']['alternative_cmdline_config'] = 'Alternativ, führe den folgenden Befehl als root-Benutzer auf der Shell aus, um die Dienste automatisch zu konfigurieren.'; diff --git a/templates/Sparkle/admin/configfiles/wizard.tpl b/templates/Sparkle/admin/configfiles/wizard.tpl index 66fbdc0a..326cb69d 100644 --- a/templates/Sparkle/admin/configfiles/wizard.tpl +++ b/templates/Sparkle/admin/configfiles/wizard.tpl @@ -8,6 +8,13 @@ $header +
+
+
{$lng['admin']['warning']}
+
{$lng['panel']['settings_before_configuration']}
+
+
+
@@ -51,10 +58,25 @@ $header + + + {$lng['panel']['done_configuring']}:

{$lng['panel']['ihave_configured']}

+ + {$lng['panel']['system_is_configured']} +
+
+ +


+
+

{$lng['panel']['alternative_cmdline_config']}:

+
+ +
+
$footer diff --git a/templates/Sparkle/assets/css/main.css b/templates/Sparkle/assets/css/main.css index 4cee4793..27926daa 100644 --- a/templates/Sparkle/assets/css/main.css +++ b/templates/Sparkle/assets/css/main.css @@ -662,13 +662,13 @@ input[type="button"], input[type="submit"], input[type="reset"], input[type="fil margin: 0 1px; } -input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover +input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover, .btnlink:hover { color: #333; background-color: #dcdcdc; } -input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active +input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, .btnlink:active { -webkit-box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.25); -moz-box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.25); @@ -676,17 +676,17 @@ input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:ac color: #fff !important; } -input[type="submit"], input[class="yesbutton"] { +input[type="submit"], input[class="yesbutton"], .btnlink { color: #fff; background-color: #35aa47; } -input[type="submit"]:hover, input[class="yesbutton"]:hover { +input[type="submit"]:hover, input[class="yesbutton"]:hover, .btnlink:hover { color: #fff; background-color: #1d943b; } -input[class="submit"]:active, input[class="yesbutton"]:active { +input[class="submit"]:active, input[class="yesbutton"]:active, .btnlink:active { background-color: #35aa47; } @@ -1725,3 +1725,14 @@ td.size-50 { .label[class*="span"][class*="arrow"] { min-height: 0 } + +.liwarn { + background-color: #ff3333; + margin-top: -6px; +} + +.liwarn a { + font-weight: 700; + padding: 5px 10px; + color: #ffe !important; +} diff --git a/templates/Sparkle/header.tpl b/templates/Sparkle/header.tpl index db30b098..ea5a177d 100644 --- a/templates/Sparkle/header.tpl +++ b/templates/Sparkle/header.tpl @@ -43,6 +43,11 @@