' . \Froxlor\UI\HTML::makecheckbox('update_changesagreed', 'I have read the update notifications above and I am aware of the changes made to my system.', '1', true, '0', true);
- $return .= '
';
- $return .= '';
+ if (empty($return['section_09']['fields'])) {
+ unset($return['section_09']);
+ }
+ if (empty($return['section_010']['fields'])) {
+ unset($return['section_010']);
+ }
+
+ if (!empty($return)) {
+ $has_preconfig = true;
+ $return['section_agree'] = [
+ 'title' => 'Check',
+ 'fields' => [
+ 'update_changesagreed' => ['type' => 'checkbox', 'value' => 1, 'label' => 'I have read the update notifications above and I am aware of the changes made to my system.'],
+ 'update_preconfig' => ['type' => 'hidden', 'value' => 1]
+ ]
+ ];
+ }
if ($has_preconfig) {
return $return;
} else {
- return '';
+ return [];
}
}
function versionInUpdate($current_version, $version_to_check)
{
- if (! \Froxlor\Froxlor::isFroxlor()) {
+ if (!\Froxlor\Froxlor::isFroxlor()) {
return true;
}
- return (\Froxlor\Froxlor::versionCompare2($current_version, $version_to_check) == - 1 ? true : false);
+ return (\Froxlor\Froxlor::versionCompare2($current_version, $version_to_check) == -1 ? true : false);
}
diff --git a/install/updates/preconfig/0.10/preconfig_0.10.inc.php b/install/updates/preconfig/0.10/preconfig_0.10.inc.php
index 91c9e140..bdb9b4c1 100644
--- a/install/updates/preconfig/0.10/preconfig_0.10.inc.php
+++ b/install/updates/preconfig/0.10/preconfig_0.10.inc.php
@@ -25,7 +25,7 @@
* @param string $current_version
* current froxlor version
*
- * @return null
+ * @return void
*/
function parseAndOutputPreconfig2(&$has_preconfig, &$return, $current_version, $current_db_version)
{
@@ -33,10 +33,9 @@ function parseAndOutputPreconfig2(&$has_preconfig, &$return, $current_version, $
if (versionInUpdate($current_db_version, '202004140')) {
$has_preconfig = true;
- $description = 'Froxlor can now optionally validate the dns entries of domains that request Lets Encrypt certificates to reduce dns-related problems (e.g. freshly registered domain or updated a-record). ';
- $question = 'Validate DNS of domains when using Lets Encrypt ';
- $question .= \Froxlor\UI\HTML::makeyesno('system_le_domain_dnscheck', '1', '0', '1');
-
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'Froxlor can now optionally validate the dns entries of domains that request Lets Encrypt certificates to reduce dns-related problems (e.g. freshly registered domain or updated a-record).';
+ $question = 'Validate DNS of domains when using Lets Encrypt';
+ $return['system_le_domain_dnscheck_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['system_le_domain_dnscheck'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
}
}
diff --git a/install/updates/preconfig/0.9/preconfig_0.9.inc.php b/install/updates/preconfig/0.9/preconfig_0.9.inc.php
index 4d2e7c62..05187b04 100644
--- a/install/updates/preconfig/0.9/preconfig_0.9.inc.php
+++ b/install/updates/preconfig/0.9/preconfig_0.9.inc.php
@@ -14,6 +14,7 @@
* @package Language
*
*/
+
use Froxlor\Database\Database;
use Froxlor\Settings;
use PHPMailer\PHPMailer;
@@ -28,7 +29,7 @@ use PHPMailer\PHPMailer;
* @param string $current_version
* current froxlor version
*
- * @return null
+ * @return void
*/
function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $current_db_version)
{
@@ -39,86 +40,90 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
$description = 'Froxlor now enables the usage of a domain-wildcard entry and subdomains for this domain at the same time (subdomains are parsed before the main-domain vhost container).';
$description .= 'This makes it possible to catch all non-existing subdomains with the main vhost but also have the ability to use subdomains for that domain. ';
$description .= 'If you would like Froxlor to do so with your domains, the update script can set the correct values for existing domains for you. Note: future domains will have wildcard-entries enabled by default no matter how you decide here.';
- $question = 'Do you want to use wildcard-entries for existing domains?: ';
- $question .= \Froxlor\UI\HTML::makeyesno('update_domainwildcardentry', '1', '0', '1');
+ $question = 'Do you want to use wildcard-entries for existing domains?:';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $return['update_domainwildcardentry_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['update_domainwildcardentry'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.6-svn2')) {
- if (! PHPMailer::ValidateAddress(Settings::Get('panel.adminmail'))) {
+ if (!PHPMailer::ValidateAddress(Settings::Get('panel.adminmail'))) {
$has_preconfig = true;
- $description = 'Froxlor uses a newer version of the phpMailerClass and determined that your current admin-mail address is invalid.';
- $question = 'Please specify a new admin-email address: ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'Froxlor uses a newer version of the PHPMailer-Class and determined that your current admin-mail address is invalid.';
+ $question = 'Please specify a new admin-email address:';
+
+ $return['update_adminmail_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['update_adminmail'] = ['type' => 'text', 'value' => Settings::Get('panel.adminmail'), 'label' => $question];
}
}
if (versionInUpdate($current_version, '0.9.6-svn3')) {
$has_preconfig = true;
$description = 'You now have the possibility to define default error-documents for your webserver which replace the default webserver error-messages.';
- $question = 'Do you want to enable default error-documents?: ';
- $question .= \Froxlor\UI\HTML::makeyesno('update_deferr_enable', '1', '0', '0') . '
';
+ $description = 'Due to a security - issue regarding open_basedir, Froxlor will set the open_basedir for the following domains to the customers root instead of the chosen documentroot: ';
+ $description .= '
';
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
foreach ($wrongOpenBasedirDomain as $domain) {
- $question .= '
';
+ $return['update_reset_openbasedirpath_note'] = ['type' => 'infotext', 'value' => $description];
}
}
if (versionInUpdate($current_version, '0.9.9-svn1')) {
$has_preconfig = true;
$description = 'When entering MX servers to Froxlor there was no mail-, imap-, pop3- and smtp-"A record" created. You can now chose whether this should be done or not.';
- $question = 'Do you want these A-records to be created even with MX servers given?: ';
- $question .= \Froxlor\UI\HTML::makeyesno('update_defdns_mailentry', '1', '0', '0');
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $question = 'Do you want these A-records to be created even with MX servers given?:';
+
+ $return['update_defdns_mailentry_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['update_defdns_mailentry'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.10-svn1')) {
@@ -157,7 +162,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'");
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
- if (! isset($result) || ! isset($result['value'])) {
+ if (!isset($result) || !isset($result['value'])) {
$has_preconfig = true;
$has_nouser = true;
$guessed_user = 'www-data';
@@ -170,7 +175,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
- if (! isset($result) || ! isset($result['value'])) {
+ if (!isset($result) || !isset($result['value'])) {
$has_preconfig = true;
$has_nogroup = true;
$guessed_group = 'www-data';
@@ -182,77 +187,79 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
if ($has_nouser || $has_nogroup) {
$description = 'Please enter the correct username/groupname of the webserver on your system We\'re guessing the user but it might not be correct, so please check.';
+ $return['update_httpusergroup_note'] = ['type' => 'infotext', 'value' => $description];
if ($has_nouser) {
- $question = 'Please enter the webservers username: ';
- } elseif ($has_nogroup) {
- $question2 = 'Please enter the webservers groupname: ';
- if ($has_nouser) {
- $question .= '
' . $question2;
- } else {
- $question = $question2;
- }
+ $question = 'Please enter the webservers username:';
+ $return['update_httpuser'] = ['type' => 'text', 'value' => $guessed_user, 'label' => $question];
+ }
+ if ($has_nogroup) {
+ $question = 'Please enter the webservers groupname:';
+ $return['update_httpgroup'] = ['type' => 'text', 'value' => $guessed_group, 'label' => $question];
}
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
}
}
if (versionInUpdate($current_version, '0.9.10')) {
$has_preconfig = true;
$description = 'you can now decide whether Froxlor should be reached via hostname/froxlor or directly via the hostname.';
- $question = 'Do you want Froxlor to be reached directly via the hostname?: ';
- $question .= \Froxlor\UI\HTML::makeyesno('update_directlyviahostname', '1', '0', '0');
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $question = 'Do you want Froxlor to be reached directly via the hostname?:';
+ $return['update_directlyviahostname_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['update_directlyviahostname'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.11-svn1')) {
$has_preconfig = true;
$description = 'It is possible to enhance security with setting a regular expression to force your customers to enter more complex passwords.';
- $question = 'Enter a regular expression to force a higher password complexity (leave empty for none): ';
- $question .= '';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $question = 'Enter a regular expression to force a higher password complexity (leave empty for none):';
+ $return['update_pwdregex_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['update_pwdregex'] = ['type' => 'text', 'value' => '', 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.11-svn3')) {
- $has_preconfig = true;
- $description = 'As Froxlor can now handle perl, you have to specify where the perl executable is (only if you\'re running lighttpd, else just leave empty).';
- $question = 'Path to perl (default \'/usr/bin/perl\'): ';
- $question .= '';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ if (Settings::Get('system.webserver') == 'lighttpd') {
+ $has_preconfig = true;
+ $description = 'As Froxlor can now handle perl, you have to specify where the perl executable is.';
+ $question = 'Path to perl (default \'/usr/bin/perl\'):';
+ $return['update_perlpath_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['update_perlpath'] = ['type' => 'text', 'value' => '/usr/bin/perl', 'label' => $question];
+ }
}
if (versionInUpdate($current_version, '0.9.12-svn1')) {
if (Settings::Get('system.mod_fcgid') == 1) {
$has_preconfig = true;
$description = 'You can chose whether you want Froxlor to use FCGID itself too now.';
- $question = 'Use FCGID for the Froxlor Panel?: ';
- $question .= \Froxlor\UI\HTML::makeyesno('update_fcgid_ownvhost', '1', '0', '0') . '
';
- $question .= 'If \'yes\', please specify local user/group (have to exist, Froxlor does not add them automatically):
';
- $question .= 'Traffic warning level: ';
- $question .= ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $question = 'Enable?:';
+ $return['update_system_report_enable_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['update_system_report_enable'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
+
+ $question = 'If \'yes\', please specify a percentage value for web-usage when reports are to be sent:';
+ $return['update_system_report_webmax'] = ['type' => 'number', 'value' => '90', 'label' => $question];
+ $question = 'If \'yes\', please specify a percentage value for traffic-usage when reports are to be sent:';
+ $return['update_system_report_trafficmax'] = ['type' => 'number', 'value' => '90', 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.18-svn2')) {
$has_preconfig = true;
$description = 'As you can (obviously) see, Froxlor now comes with a new theme. You also have the possibility to switch back to "Classic" if you want to.';
- $question = 'Select default panel theme: ';
- $question .= '';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $return['update_default_theme'] = [
+ 'type' => 'select',
+ 'select_var' => $sel_themes,
+ 'selected' => 'Froxlor',
+ 'label' => $question
+ ];
}
if (versionInUpdate($current_version, '0.9.28-svn4')) {
@@ -398,16 +419,19 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
$description .= '
Notice: This update will alter your Froxlor database to use UTF-8 as default charset. ';
$description .= 'Even though this is already tested, we strongly recommend to ';
$description .= 'test this update in a testing environment using your existing data.
';
-
- $question = 'Select your preferred Classic Theme replacement: ';
- $question .= '';
-
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $return['classic_theme_replacement'] = [
+ 'type' => 'select',
+ 'select_var' => $sel_themes,
+ 'selected' => 'Froxlor',
+ 'label' => $question
+ ];
}
if (versionInUpdate($current_version, '0.9.28-svn6')) {
@@ -416,16 +440,16 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
$has_preconfig = true;
$description = 'Froxlor now supports the new Apache 2.4. Please be aware that you need to load additional apache-modules in order to use it. ';
$description .= '
';
- $question = 'Do you want to enable the Apache-2.4 modification?: ';
- $question .= \Froxlor\UI\HTML::makeyesno('update_system_apache24', '1', '0', '0');
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ LoadModule authz_host_module modules/mod_authz_host.so';
+ $question = 'Do you want to enable the Apache-2.4 modification?:';
+ $return['update_system_apache24_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['update_system_apache24'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
} elseif (Settings::Get('system.webserver') == 'nginx') {
$has_preconfig = true;
- $description = 'The path to nginx\'s fastcgi_params file is now customizable.
';
- $question = 'Please enter full path to you nginx/fastcgi_params file (including filename): ';
- $question .= '';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'The path to nginx\'s fastcgi_params file is now customizable.';
+ $question = 'Please enter full path to you nginx/fastcgi_params file (including filename):';
+ $return['nginx_fastcgi_params_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['nginx_fastcgi_params'] = ['type' => 'text', 'value' => "/etc/nginx/fastcgi_params", 'label' => $question];
}
}
@@ -434,12 +458,10 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
$has_preconfig = true;
$description = 'This version adds an option to append the domain-name to the document-root for domains and subdomains. ';
- $description .= 'You can enable or disable this feature anytime from settings -> system settings. ';
-
- $question = 'Do you want to automatically append the domain-name to the documentroot of newly created domains?: ';
- $question .= \Froxlor\UI\HTML::makeyesno('update_system_documentroot_use_default_value', '1', '0', '0');
-
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description .= 'You can enable or disable this feature anytime from settings -> system settings.';
+ $question = 'Do you want to automatically append the domain-name to the documentroot of newly created domains?:';
+ $return['update_system_documentroot_use_default_value_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['update_system_documentroot_use_default_value'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.28')) {
@@ -451,56 +473,53 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
$description .= 'If you don\'t have any problems with sending mails, you don\'t need to change this';
if (Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1') {
// information about removal of php's safe_mode
- $description .= '
The php safe_mode flag has been removed as current versions of PHP ';
- $description .= 'do not support it anymore.
';
+ $description .= '
The php safe_mode flag has been removed as current versions of PHP do not support it anymore.
';
$description .= 'Please check your php-configurations and remove safe_mode-directives to avoid php notices/warnings.';
}
- $question = '';
-
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $return['update_default_sendmail_params_note'] = ['type' => 'infotext', 'value' => $description];
}
if (versionInUpdate($current_version, '0.9.29-dev1')) {
// we only need to ask if fcgid|php-fpm is enabled
if (Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1') {
$has_preconfig = true;
- $description = 'Standard-subdomains can now be hidden from the php-configuration overview. ';
- $question = 'Do you want to hide the standard-subdomains (this can be changed in the settings any time)?: ';
- $question .= \Froxlor\UI\HTML::makeyesno('hide_stdsubdomains', '1', '0', '0');
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'Standard-subdomains can now be hidden from the php-configuration overview.';
+ $question = 'Do you want to hide the standard-subdomains (this can be changed in the settings any time)?:';
+ $return['hide_stdsubdomains_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['hide_stdsubdomains'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
}
}
if (versionInUpdate($current_version, '0.9.29-dev2')) {
$has_preconfig = true;
$description = 'You can now decide whether admins/customers are able to change the theme ';
- $question = 'If you want to disallow theme-changing, select "no" from the dropdowns: ';
- $question .= "Admins: " . \Froxlor\UI\HTML::makeyesno('allow_themechange_a', '1', '0', '1') . ' ';
- $question .= "Customers: " . \Froxlor\UI\HTML::makeyesno('allow_themechange_c', '1', '0', '1');
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $return['allow_themechange_ac_note'] = ['type' => 'infotext', 'value' => $description];
+ $question = 'Allow theme-changing for admins:';
+ $return['allow_themechange_a'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
+ $question = 'Allow theme-changing for customers:';
+ $return['allow_themechange_c'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.29-dev3')) {
$has_preconfig = true;
- $description = 'There is now a possibility to specify AXFR servers for your bind zone-configuration ';
- $question = 'Enter a comma-separated list of AXFR servers or leave empty (default): ';
- $question .= '';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'There is now a possibility to specify AXFR servers for your bind zone-configuration';
+ $question = 'Enter a comma-separated list of AXFR servers or leave empty (default):';
+ $return['system_afxrservers_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['system_afxrservers'] = ['type' => 'text', 'value' => '', 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.29-dev4')) {
$has_preconfig = true;
- $description = 'As customers can now specify ssl-certificate data for their domains, you need to specify where the generated files are stored ';
- $question = 'Specify the directory for customer ssl-certificates: ';
- $question .= '';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'As customers can now specify ssl-certificate data for their domains, you need to specify where the generated files are stored';
+ $question = 'Specify the directory for customer ssl-certificates:';
+ $return['system_customersslpath_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['system_customersslpath'] = ['type' => 'text', 'value' => '/etc/ssl/froxlor-custom/', 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.29.1-dev3')) {
$has_preconfig = true;
$description = 'The build in logrotation-feature has been removed. Please follow the configuration-instructions for your system to enable logrotating again.';
- $question = '';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $return['update_removed_builtin_logrotate_note'] = ['type' => 'infotext', 'value' => $description];
}
// let the apache+fpm users know that they MUST change their config
@@ -518,216 +537,232 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
Allow from env=REDIRECT_STATUS
</Location>
</IfModule>';
- $question = '';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $return['update_fpm_implementation_changed_note'] = ['type' => 'infotext', 'value' => $description];
}
}
if (versionInUpdate($current_version, '0.9.31-dev2')) {
if (Settings::Get('system.webserver') == 'apache2' && Settings::Get('phpfpm.enabled') == '1') {
$has_preconfig = true;
- $description = 'The FPM socket directory is now a setting in froxlor. Its default is /var/lib/apache2/fastcgi/. If you are using /var/run/apache2 in the "fastcgi.conf" (Debian/Ubuntu) or "70_fastcgi.conf" (Gentoo) please correct this path accordingly ';
- $question = '';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'The FPM socket directory is now a setting in froxlor. Its default is /var/lib/apache2/fastcgi/. If you are using /var/run/apache2 in the "fastcgi.conf" (Debian/Ubuntu) or "70_fastcgi.conf" (Gentoo) please correct this path accordingly';
+ $return['update_fpm_socket_directory_changed_note'] = ['type' => 'infotext', 'value' => $description];
}
}
if (versionInUpdate($current_version, '0.9.31-dev4')) {
$has_preconfig = true;
- $description = 'The template-variable {PASSWORD} has been replaced with {LINK}. Please update your password reset templates! ';
- $question = '';
+ $description = 'The template-variable {PASSWORD} has been replaced with {LINK}. Please update your password reset templates!';
+ $return['update_template_var_password_changed_note'] = ['type' => 'infotext', 'value' => $description];
eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
}
if (versionInUpdate($current_version, '0.9.31-dev5')) {
$has_preconfig = true;
- $description = 'You can enable/disable error-reporting for admins and customers!
';
- $question = 'Do you want to enable error-reporting for admins? (default: yes): ';
- $question .= \Froxlor\UI\HTML::makeyesno('update_error_report_admin', '1', '0', '1') . ' ';
- $question .= 'Do you want to enable error-reporting for customers? (default: no): ';
- $question .= \Froxlor\UI\HTML::makeyesno('update_error_report_customer', '1', '0', '0');
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'You can enable/disable error-reporting for admins and customers!';
+ $return['update_error_report_admin_customer_note'] = ['type' => 'infotext', 'value' => $description];
+
+ $question = 'Do you want to enable error-reporting for admins? (default: yes):';
+ $return['update_error_report_admin'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
+ $question = 'Do you want to enable error-reporting for customers? (default: no):';
+ $return['update_error_report_customer'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.31-rc2')) {
$has_preconfig = true;
- $description = 'You can enable/disable the display/usage of the news-feed for admins
';
- $question = 'Do you want to enable the news-feed for admins? (default: yes): ';
- $question .= \Froxlor\UI\HTML::makeyesno('update_admin_news_feed', '1', '0', '1') . ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'You can enable/disable the display/usage of the news-feed for admins';
+ $question = 'Do you want to enable the news-feed for admins? (default: yes):';
+ $return['update_admin_news_feed_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['update_admin_news_feed'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.32-dev2')) {
$has_preconfig = true;
- $description = 'To enable logging of the mail-traffic, you need to set the following settings accordingly
';
- $question = 'Do you want to enable the traffic collection for mail? (default: yes): ';
- $question .= \Froxlor\UI\HTML::makeyesno('mailtraffic_enabled', '1', '0', '1') . ' ';
- $question .= 'Mail Transfer Agent ';
- $question .= 'Type of your MTA: ';
- $question .= ' ';
- $question .= 'Logfile for your MTA: ';
- $question .= ' ';
- $question .= 'Mail Delivery Agent ';
- $question .= 'Type of your MDA: ';
- $question .= '
';
- $question .= 'Logfile for your MDA: ';
- $question .= ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'To enable logging of the mail-traffic, you need to set the following settings accordingly';
+ $question = 'Do you want to enable the traffic collection for mail? (default: yes):';
+ $return['mailtraffic_enabled_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['mailtraffic_enabled'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
+
+ $question = 'Mail Transfer Agent';
+ $return['mtaserver'] = [
+ 'type' => 'select',
+ 'select_var' => [
+ 'postfix' => 'Postfix',
+ 'exim4' => 'Exim4'
+ ],
+ 'selected' => 'postfix',
+ 'label' => $question
+ ];
+
+ $question = 'Logfile for your MTA:';
+ $return['mtalog'] = ['type' => 'text', 'value' => "/var/log/mail.log", 'label' => $question];
+
+ $question = 'Mail Delivery Agent';
+ $return['mdaserver'] = [
+ 'type' => 'select',
+ 'select_var' => [
+ 'dovecot' => 'Dovecot',
+ 'courier' => 'Courier'
+ ],
+ 'selected' => 'dovecot',
+ 'label' => $question
+ ];
+
+ $question = 'Logfile for your MDA:';
+ $return['mdalog'] = ['type' => 'text', 'value' => "/var/log/mail.log", 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.32-dev5')) {
$has_preconfig = true;
- $description = 'Froxlor now generates a cron-configuration file for the cron-daemon. Please set a filename which will be included automatically by your crond (e.g. files in /etc/cron.d/)
';
- $question = 'Path to the cron-service configuration-file. This file will be updated regularly and automatically by froxlor. Note: please be sure to use the same filename as for the main froxlor cronjob (default: /etc/cron.d/froxlor)! ';
- $question .= ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'Froxlor now generates a cron-configuration file for the cron-daemon. Please set a filename which will be included automatically by your crond (e.g. files in /etc/cron.d/)';
+ $question = 'Path to the cron-service configuration-file. This file will be updated regularly and automatically by froxlor. Note: please be sure to use the same filename as for the main froxlor cronjob (default: /etc/cron.d/froxlor)!';
+ $return['crondfile_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['crondfile'] = ['type' => 'text', 'value' => "/etc/cron.d/froxlor", 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.32-dev6')) {
$has_preconfig = true;
- $description = 'In order for the new cron.d file to work properly, we need to know about the cron-service reload command.
';
- $question = 'Please specify the reload-command of your cron-daemon (default: /etc/init.d/cron reload) ';
- $question .= ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'In order for the new cron.d file to work properly, we need to know about the cron-service reload command.';
+ $question = 'Please specify the reload-command of your cron-daemon (default: /etc/init.d/cron reload)';
+ $return['crondreload_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['crondreload'] = ['type' => 'text', 'value' => "/etc/init.d/cron reload", 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.32-rc2')) {
$has_preconfig = true;
- $description = 'To customize the command which executes the cronjob (php - basically) change the path below according to your system.
';
- $question = 'Please specify the command to execute cronscripts (default: "/usr/bin/nice -n 5 /usr/bin/php -q") ';
- $question .= ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'To customize the command which executes the cronjob (php - basically) change the path below according to your system.';
+ $question = 'Please specify the command to execute cronscripts (default: "/usr/bin/nice -n 5 /usr/bin/php -q")';
+ $return['croncmdline_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['croncmdline'] = ['type' => 'text', 'value' => "/usr/bin/nice -n 5 /usr/bin/php -q", 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.33-dev1')) {
$has_preconfig = true;
- $description = 'You can enable/disable the display/usage of the custom newsfeed for customers.
';
- $question = 'Do you want to enable the custom newsfeed for customer? (default: no): ';
- $question .= \Froxlor\UI\HTML::makeyesno('customer_show_news_feed', '1', '0', '0') . ' ';
- $question .= 'You have to set the URL for your RSS-feed here, if you have chosen to enable the custom newsfeed on the customer-dashboard: ';
- $question .= ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'You can enable/disable the display/usage of the custom newsfeed for customers.';
+ $question = 'Do you want to enable the custom newsfeed for customer? (default: no):';
+ $return['customer_show_news_feed_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['customer_show_news_feed'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
+
+ $question = 'You have to set the URL for your RSS-feed here, if you have chosen to enable the custom newsfeed on the customer-dashboard:';
+ $return['customer_news_feed_url'] = ['type' => 'text', 'value' => "", 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.33-dev2')) {
// only if bind is used - if not the default will be set, which is '0' (off)
if (Settings::get('system.bind_enable') == 1) {
$has_preconfig = true;
- $description = 'You can enable/disable the generation of the bind-zone / config for the system hostname.
';
- $question = 'Do you want to generate a bind-zone for the system-hostname? (default: no): ';
- $question .= \Froxlor\UI\HTML::makeyesno('dns_createhostnameentry', '1', '0', '0') . ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'You can enable/disable the generation of the bind-zone / config for the system hostname.';
+ $question = 'Do you want to generate a bind-zone for the system-hostname? (default: no):';
+ $return['dns_createhostnameentry_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['dns_createhostnameentry'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
}
}
if (versionInUpdate($current_version, '0.9.33-rc2')) {
$has_preconfig = true;
- $description = 'You can chose whether you want to receive an e-mail on cronjob errors. Keep in mind that this can lead to an e-mail being sent every 5 minutes.
';
- $question = 'Do you want to receive cron-errors via mail? (default: no): ';
- $question .= \Froxlor\UI\HTML::makeyesno('system_send_cron_errors', '1', '0', '0') . ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'You can chose whether you want to receive an e-mail on cronjob errors. Keep in mind that this can lead to an e-mail being sent every 5 minutes.';
+ $question = 'Do you want to receive cron-errors via mail? (default: no):';
+ $return['system_send_cron_errors_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['system_send_cron_errors'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
}
if (versionInUpdate($current_version, '0.9.34-dev3')) {
$has_preconfig = true;
- $description = 'Froxlor now requires the PHP mbstring-extension as we need to be multibyte-character safe in some cases';
- $question = 'PHP mbstring is currently: ';
- if (! extension_loaded('mbstring')) {
- $question .= 'not installed/loaded';
- $question .= ' Please install the PHP mbstring extension in order to finish the update';
+ $description = 'Froxlor now requires the PHP mbstring-extension as we need to be multibyte-character safe in some cases
';
+ $description .= 'PHP mbstring is currently: ';
+ if (!extension_loaded('mbstring')) {
+ $description .= 'not installed/loaded';
+ $description .= ' Please install the PHP mbstring extension in order to finish the update';
} else {
- $question .= 'installed/loaded';
+ $description .= 'installed/loaded';
}
- $question .= ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $return['update_php_mbstring_extension_installed_note'] = ['type' => 'infotext', 'value' => $description];
}
if (versionInUpdate($current_db_version, '201603070')) {
$has_preconfig = true;
- $description = 'You can chose whether you want to enable or disable our Let\'s Encrypt implementation. Please remember that you need to go through the webserver-configuration when enabled because this feature needs a special configuration.
';
- $question = 'Do you want to enable Let\'s Encrypt? (default: yes): ';
- $question .= \Froxlor\UI\HTML::makeyesno('enable_letsencrypt', '1', '0', '1') . ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'You can chose whether you want to enable or disable our Let\'s Encrypt implementation. Please remember that you need to go through the webserver-configuration when enabled because this feature needs a special configuration.';
+ $question = 'Do you want to enable Let\'s Encrypt? (default: yes):';
+ $return['enable_letsencrypt_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['enable_letsencrypt'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
}
if (versionInUpdate($current_db_version, '201604270')) {
$has_preconfig = true;
- $description = 'You can chose whether you want to enable or disable our backup function.
';
- $question = 'Do you want to enable Backup? (default: no): ';
- $question .= \Froxlor\UI\HTML::makeyesno('enable_backup', '1', '0', '0') . ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'You can chose whether you want to enable or disable our backup function.';
+ $question = 'Do you want to enable Backup? (default: no):';
+ $return['enable_backup_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['enable_backup'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
}
if (versionInUpdate($current_db_version, '201605090')) {
$has_preconfig = true;
- $description = 'You can chose whether you want to enable or disable our DNS editor
';
- $question = 'Do you want to enable the DNS editor? (default: no): ';
- $question .= \Froxlor\UI\HTML::makeyesno('enable_dns', '1', '0', '0') . ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'You can chose whether you want to enable or disable our DNS editor';
+ $question = 'Do you want to enable the DNS editor? (default: no):';
+ $return['enable_dns_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['enable_dns'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
}
if (versionInUpdate($current_db_version, '201605170')) {
$has_preconfig = true;
$description = 'Froxlor now supports the dns-daemon Power-DNS, you can chose between bind and powerdns now.';
- $question = 'Select dns-daemon you want to use: ';
- $question .= '';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $return['new_dns_daemon_note'] = ['type' => 'infotext', 'value' => $description];
+ $question = 'Select dns-daemon you want to use:';
+ $return['new_dns_daemon'] = [
+ 'type' => 'select',
+ 'select_var' => [
+ 'bind' => 'Bind9',
+ 'pdns' => 'PowerDNS'
+ ],
+ 'selected' => 'bind',
+ 'label' => $question
+ ];
}
if (versionInUpdate($current_db_version, '201609120')) {
if (Settings::Get('system.leenabled') == 1) {
$has_preconfig = true;
- $description = 'You can now customize the path to your acme.conf file (global alias for Let\'s Encrypt). If you already set up Let\'s Encrypt and the acme.conf file, please set this to the complete path to the file!
';
- $question = 'Path to the acme.conf alias-file. ';
- $question .= ' ';
- eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
+ $description = 'You can now customize the path to your acme.conf file (global alias for Let\'s Encrypt). If you already set up Let\'s Encrypt and the acme.conf file, please set this to the complete path to the file!';
+ $question = 'Path to the acme.conf alias-file.';
+ $return['acmeconffile_note'] = ['type' => 'infotext', 'value' => $description];
+ $return['acmeconffile'] = ['type' => 'text', 'value' => "/etc/apache2/conf-enabled/acme.conf", 'label' => $question];
}
}
if (versionInUpdate($current_db_version, '201609200')) {
$has_preconfig = true;
- $description = 'Specify SMTP settings which froxlor should use to send mail (optional)
-
-
+ {% if form_data.buttons is defined and form_data.buttons is iterable %}
+ {% for btn in form_data.buttons %}
+
+ {% endfor %}
+ {% else %}
+
+
+ {% endif %}
diff --git a/templates/Froxlor/user/form-replacers.html.twig b/templates/Froxlor/user/form-replacers.html.twig
index a1cd88c7..d96d743b 100644
--- a/templates/Froxlor/user/form-replacers.html.twig
+++ b/templates/Froxlor/user/form-replacers.html.twig
@@ -5,7 +5,7 @@
{{ parent() }}
{% if replacers is not empty and replacers is iterable %}
-
diff --git a/templates/Froxlor/user/form.html.twig b/templates/Froxlor/user/form.html.twig
index 4792357d..d2874afa 100644
--- a/templates/Froxlor/user/form.html.twig
+++ b/templates/Froxlor/user/form.html.twig
@@ -18,6 +18,28 @@
{% endblock %}
+{% block actions %}
+
+ {% if actions_links is iterable or (entity_info is defined and entity_info is not empty) %}
+
+ {% if actions_links is iterable %}
+ {% for link in actions_links %}
+
+ {{ link.label }}
+
+ {% endfor %}
+ {% endif %}
+ {# TODO: eventually not used anymore because of using a documentation link
+ {% if entity_info is defined and entity_info is not empty %}
+