Commit d1b62a66 authored by Florian Schaal's avatar Florian Schaal

use prior dns-zone if the new zone fails (# 4107)

parent 98323f1b
......@@ -215,6 +215,15 @@ class page_action extends tform_actions {
//* we are editing a existing record
$app->tpl->setVar("edit_disabled", 1);
$app->tpl->setVar("server_id_value", $this->dataRecord["server_id"]);
$datalog = $app->db->queryOneRecord("SELECT sys_datalog.error, sys_log.tstamp FROM sys_datalog, sys_log WHERE sys_datalog.dbtable = 'dns_soa' AND sys_datalog.dbidx = ? AND sys_datalog.datalog_id = sys_log.datalog_id AND sys_log.message = CONCAT('Processed datalog_id ',sys_log.datalog_id) ORDER BY sys_datalog.tstamp DESC", 'id:' . $this->id);
if(is_array($datalog) && !empty($datalog)){
if(trim($datalog['error']) != ''){
$app->tpl->setVar("config_error_msg", nl2br(htmlentities($datalog['error'])));
$app->tpl->setVar("config_error_tstamp", date($app->lng('conf_format_datetime'), $datalog['tstamp']));
}
}
} else {
$app->tpl->setVar("edit_disabled", 0);
}
......
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,7 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Podepsat zónu (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['ttl_range_error'] = 'Min. TTL ist 60 Sekunden.';
$wb['xfer_error_regex'] = 'Zonentransfer: Verwenden Sie eine oder mehrere durch Komma getrennte IP Adressen oder das Wort: any.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'The Zone (SOA) can not be changed. Please contact your administrator to change the zone.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['minimum_range_error'] = 'Min. Minimum time is 60 seconds.';
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'The Zone (SOA) can not be changed. Please contact your administrator to change the zone.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['ttl_txt'] = 'TTL';
$wb['update_acl_txt'] = 'Actualizar ACL';
$wb['xfer_error_regex'] = 'Notificar también a: Por favor, usa una dirección IP.';
$wb['xfer_txt'] = 'Permitir transferencia de zonas a<br />estas IP (lista separada por comas)';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'Die Zone (SOA) kann nicht verändert werden. Bitte kontaktieren Sie ihren Administrator, um die Zone zu ändern.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -40,4 +40,5 @@ $wb['dnssec_wanted_txt'] = 'Sign zone (DNSSEC)';
$wb['dnssec_wanted_info'] = 'When disabling DNSSEC keys are not going to be deleted if DNSSEC was enabled before and keys already have been generated but the zone will no longer be delievered in signed format afterwards.';
$wb['error_not_allowed_server_id'] = 'The selected server is not allowed for this account.';
$wb['soa_cannot_be_changed_txt'] = 'The Zone (SOA) can not be changed. Please contact your administrator to change the zone.';
$wb['configuration_error_txt'] = 'CONFIGURATION ERROR';
?>
......@@ -3,6 +3,12 @@
</div>
<p><tmpl_var name="list_desc_txt"></p>
<tmpl_if name="config_error_msg">
<div style="background: #ffdfdf; border: 1px solid #df7d7d; border-width: 1px 0; margin: 1.5em 0 1.5em 0; padding: 7px;">
<p style="font-face:bold">{tmpl_var name='configuration_error_txt'}</p>
<div><div style="float:left;width:150px;">{tmpl_var name='config_error_tstamp'} :&nbsp;</div><div style="padding-left:150px;">{tmpl_var name='config_error_msg'}</div></div>
</div>
</tmpl_if>
<legend>DNS Zone</legend>
<tmpl_if name="is_admin">
......
......@@ -265,6 +265,7 @@ class bind_plugin {
$filename = escapeshellcmd($dns_config['bind_zonefiles_dir'].'/pri.'.str_replace("/", "_", substr($zone['origin'], 0, -1)));
}
$old_zonefile = @file_get_contents($filename);
file_put_contents($filename, $tpl->grab());
chown($filename, escapeshellcmd($dns_config['bind_user']));
chgrp($filename, escapeshellcmd($dns_config['bind_group']));
......@@ -275,12 +276,20 @@ class bind_plugin {
if($return_status === 0) {
$app->log("Writing BIND domain file: ".$filename, LOGLEVEL_DEBUG);
} else {
if($dns_config['disable_bind_log'] === 'y') {
$app->log("Writing BIND domain file failed: ".$filename." ".implode(' ', $out), LOGLEVEL_DEBUG);
$loglevel = @($dns_config['disable_bind_log'] === 'y')?:'LOGLEVEL_DEBUG':'LOGLEVEL_WARN';
$app->log("Writing BIND domain file failed: ".$filename." ".implode(' ', $out), $loglevel);
if(is_array($out) && !empty($out)){
$app->log('Reason for Bind restart failure: '.implode("\n", $out), $loglevel);
$app->dbmaster->datalogError(implode("\n", $out));
}
if ($old_zonefile != '') {
rename($filename, $filename.'.err');
file_put_contents($filename, $old_zonefile);
chown($filename, escapeshellcmd($dns_config['bind_user']));
chgrp($filename, escapeshellcmd($dns_config['bind_group']));
} else {
$app->log("Writing BIND domain file failed: ".$filename." ".implode(' ', $out), LOGLEVEL_WARN);
rename($filename, $filename.'.err');
}
rename($filename, $filename.'.err');
}
unset($tpl);
unset($records);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment