Commit d021ef61 authored by Sergio's avatar Sergio

check dns use of domain before delete domain from client

parent 9664e7fe
......@@ -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