Commit d57ffdc6 authored by Marius Cramer's avatar Marius Cramer

Merge branch 'dns_delete_check' into 'master'

Dns delete check

Now dns zone requires domain is created on domain module (if that feature is enabled), it should be checked as mail domain and web sites are checked.
parents 9664e7fe d021ef61
......@@ -62,6 +62,18 @@ class page_action extends tform_actions {
*/
$domain = $this->dataRecord['domain'];
$sql = "SELECT id FROM dns_soa WHERE origin = '" . $app->db->quote($domain.".") . "'";
$res = $app->db->queryOneRecord($sql);
if (is_array($res)){
$app->error($wb['error_domain_in dnsuse']);
}
$sql = "SELECT id FROM dns_slave WHERE origin = '" . $app->db->quote($domain.".") . "'";
$res = $app->db->queryOneRecord($sql);
if (is_array($res)){
$app->error($wb['error_domain_in dnsslaveuse']);
}
$sql = "SELECT domain_id FROM mail_domain WHERE domain = '" . $app->db->quote($domain) . "'";
$res = $app->db->queryOneRecord($sql);
if (is_array($res)){
......
......@@ -19,6 +19,8 @@ $wb['Edit Client Circle'] = 'Edit Client Circle';
$wb['Domains'] = 'Domains';
$wb['domain_txt'] = 'Domain';
$wb['client_txt'] = 'Client';
$wb['error_domain_in dnsuse'] = 'This domain cannot be deleted, because it is in use as dns zone';
$wb['error_domain_in dnsslaveuse'] = 'This domain cannot be deleted, because it is in use as secondary dns zone';
$wb['error_domain_in mailuse'] = 'This domain cannot be deleted, because it is in use as mail-domain';
$wb['error_domain_in webuse'] = 'This domain cannot be deleted, because it is in use as web-domain';
$wb['error_client_can_not_add_domain'] = 'You cannot add a new domain';
......
......@@ -20,6 +20,8 @@ $wb['Edit Client Circle'] = 'Editar círculo de clientes';
$wb['Domains'] = 'Dominios';
$wb['domain_txt'] = 'Dominio';
$wb['client_txt'] = 'Cliente';
$wb['error_domain_in dnsuse'] = 'No se puede eliminar este dominio, porque está en uso como zona dns';
$wb['error_domain_in dnsslaveuse'] = 'No se puede eliminar este dominio, porque está en uso como zona dns secundaria';
$wb['error_domain_in mailuse'] = 'No se puede eliminar este dominio, porque está en uso como dominio de correo';
$wb['error_domain_in webuse'] = 'No se puede eliminar este dominio, porque está en uso como sitio web';
$wb['error_client_can_not_add_domain'] = 'No puedes añadir más dominios';
......
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