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

@@ -78,6 +78,14 @@ return array(
'default' => '',
'save_method' => 'storeSettingField',
),
'system_dns_createhostnameentry' => array(
'label' => $lng['serversettings']['dns_createhostnameentry'],
'settinggroup' => 'system',
'varname' => 'dns_createhostnameentry',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField'
),
'system_dns_createmailentry' => array(
'label' => $lng['serversettings']['mail_also_with_mxservers'],
'settinggroup' => 'system',

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") . "\";");
}
}
}

View File

@@ -143,7 +143,7 @@ fwrite($debugHandler, 'Database-connection established' . "\n");
* if using fcgid or fpm for froxlor-vhost itself, we have to check
* whether the permission of the files are still correct
*/
fwrite($debugHandler, 'Checking froxlor file permissions');
fwrite($debugHandler, 'Checking froxlor file permissions'."\n");
$_mypath = makeCorrectDir(FROXLOR_INSTALL_DIR);
if (((int)Settings::Get('system.mod_fcgid') == 1 && (int)Settings::Get('system.mod_fcgid_ownvhost') == 1)

View File

@@ -51,6 +51,6 @@ define('TABLE_PANEL_DOMAIN_SSL_SETTINGS', 'domain_ssl_settings');
define('TABLE_DOMAINTOIP', 'panel_domaintoip');
// VERSION INFO
$version = '0.9.33-dev1';
$version = '0.9.33-dev2';
$dbversion = '2';
$branding = '';

View File

@@ -1822,3 +1822,4 @@ $lng['error']['passwordshouldnotbeusername'] = 'The password should not be the s
// Added in Froxlor 0.9.33
$lng['admin']['customer_show_news_feed'] = "Show custom newsfeed on customer-dashboard";
$lng['admin']['customer_news_feed_url'] = "RSS-Feed for the custom newsfeed";
$lng['serversettings']['dns_createhostnameentry'] = "Create bind-zone/config for system hostname";

View File

@@ -1546,3 +1546,4 @@ $lng['error']['passwordshouldnotbeusername'] = 'Das Passwort sollte nicht mit de
// Added in Froxlor 0.9.33
$lng['admin']['customer_show_news_feed'] = "Zeige benutzerdefinierten Newsfeed im Kunden-Dashboard";
$lng['admin']['customer_news_feed_url'] = "RSS-Feed für den benutzerdefinierten Newsfeed";
$lng['serversettings']['dns_createhostnameentry'] = "Erstelle bind-Zone/Konfiguration für den System-Hostnamen";

View File

@@ -89,17 +89,19 @@ class bind {
}
// frolxor-hostname (#1090)
$hostname_arr = array(
'id' => 'none',
'domain' => Settings::Get('system.hostname'),
'customerid' => 'none',
'loginname' => 'froxlor.panel',
'bindserial' => date('Ymd').'00',
'dkim' => '0',
'iswildcarddomain' => '1',
'zonefile' => ''
);
$bindconf_file .= $this->_generateDomainConfig($hostname_arr, true);
if (Settings::get('system.dns_createhostnameentry') == 1) {
$hostname_arr = array(
'id' => 'none',
'domain' => Settings::Get('system.hostname'),
'customerid' => 'none',
'loginname' => 'froxlor.panel',
'bindserial' => date('Ymd').'00',
'dkim' => '0',
'iswildcarddomain' => '1',
'zonefile' => ''
);
$bindconf_file .= $this->_generateDomainConfig($hostname_arr, true);
}
$bindconf_file_handler = fopen(makeCorrectFile(Settings::Get('system.bindconf_directory') . '/froxlor_bind.conf'), 'w');
fwrite($bindconf_file_handler, $bindconf_file);