add option to enable/disable generation of bind-configs for the system-hostname

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2014-06-02 12:35:45 +02:00
parent 0d04077d6e
commit f1eb5420a7
9 changed files with 48 additions and 14 deletions

View File

@@ -504,6 +504,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('system', 'crondreload', '/etc/init.d/cron reload'),
('system', 'croncmdline', '/usr/bin/nice -n 5 /usr/bin/php5 -q'),
('system', 'cron_allowautoupdate', '0'),
('system', 'dns_createhostnameentry', '0'),
('panel', 'decimal_places', '4'),
('panel', 'adminmail', 'admin@SERVERNAME'),
('panel', 'phpmyadmin_url', ''),
@@ -531,7 +532,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('panel', 'phpconfigs_hidestdsubdomain', '0'),
('panel', 'allow_theme_change_admin', '1'),
('panel', 'allow_theme_change_customer', '1'),
('panel', 'version', '0.9.32');
('panel', 'version', '0.9.33-dev2');
DROP TABLE IF EXISTS `panel_tasks`;

View File

@@ -2781,3 +2781,13 @@ if (isFroxlorVersion('0.9.32')) {
updateToVersion('0.9.33-dev1');
}
if (isFroxlorVersion('0.9.33-dev1')) {
showUpdateStep("Updating from 0.9.33-dev1 to 0.9.33-dev2", false);
showUpdateStep("Adding settings for hostname-dns-entry");
Settings::AddNew("system.dns_createhostnameentry", isset($_POST['dns_createhostnameentry']) ? (int)$_POST['dns_createhostnameentry'] : '0');
lastStepStatus(0);
updateToVersion('0.9.33-dev2');
}

View File

@@ -668,4 +668,15 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) {
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
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.<br /><br />';
$question = '<strong>Do you want to generate a bind-zone for the system-hostname? (default: no):</strong>&nbsp;';
$question.= makeyesno('dns_createhostnameentry', '1', '0', '0').'<br />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}
}