From 9a26f1fad87a812d86ed06b4265c54d308a29a8a Mon Sep 17 00:00:00 2001 From: David Ramos Date: Tue, 2 Jan 2018 13:41:14 +0100 Subject: [PATCH] =?UTF-8?q?Versi=C3=B3n=20v2.0.=20Mejora=20de=20los=20mesa?= =?UTF-8?q?jes=20de=20error.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clases/limites.inc.php | 18 ++++++++++++++---- lib/lang/en_new_service_webdns.lng | 1 + lib/lang/es_new_service_webdns.lng | 3 ++- new_service_webdns.php | 13 +++++++++---- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/clases/limites.inc.php b/clases/limites.inc.php index abd7ffd..5828709 100644 --- a/clases/limites.inc.php +++ b/clases/limites.inc.php @@ -60,7 +60,7 @@ class limites { return true; } } - //* If the client belongs to a reseller, we will check against the reseller Limit too + //* If the client belongs to a reseller, we will check against the reseller Limit too if($this->cliente['parent_client_id'] != 0) { //* first we need to know the groups of this reseller $this->getRevendedor(); @@ -83,12 +83,22 @@ class limites { $app->error($reseller['contact_firstname'] . '. ' . $app->tform->wordbook["limit_dns_zone_txt"]); return true; } - /*$tmp = $app->db->queryOneRecord( - "SELECT count(id) as number FROM dns_soa WHERE sys_groupid = ?", explode(',', $reseller_groups)); + /* $tmp = $app->db->queryOneRecord( + "SELECT count(id) as number FROM dns_soa WHERE sys_groupid = ?", explode(',', $this->revendedor_grupos)); echo(' El temp registros en dns_soa usando grupo reseller ' .$tmp['number']);*/ + /* $sumaTotal = 0; + $todosLosGrupos = explode(',', $this->revendedor_grupos); + foreach($todosLosGrupos as $grupos) { + $tmpReventaALL = $app->db->queryOneRecord( + "SELECT count(id) as number FROM dns_soa WHERE sys_groupid = ?", $grupos); + $sql = "SELECT count(id) as number FROM dns_soa WHERE sys_groupid = ". $grupos; + echo(' Valores ' . $tmpReventaALL['number']); + $sumaTotal =+ $tmpReventaALL['number']; + echo($sumaTotal); + }*/ /*if($tmp['number'] >= $reseller['number']) { - $app->error($app->tform->wordbook["limit_dns_zone_txt"]. ' Dentro Limites'); + $app->error($app->tform->wordbook["limit_dns_zone_txt"]); return true; }*/ } diff --git a/lib/lang/en_new_service_webdns.lng b/lib/lang/en_new_service_webdns.lng index 89bff60..3cc30b3 100755 --- a/lib/lang/en_new_service_webdns.lng +++ b/lib/lang/en_new_service_webdns.lng @@ -91,6 +91,7 @@ $wb["limit_dns_zone_txt"] = 'The max. number of DNS zones for your account is re $wb["apache_directives_txt"] = 'Apache Directives'; $wb["domain_error_empty"] = 'Domain is empty.'; $wb["domain_error_unique"] = 'There is already a website or sub / aliasdomain with this domain name.'; +$wb['domain_error_unique_webdns'] = 'Ya existe una zona dns con este nombre de dominio.'; $wb["domain_error_regex"] = 'Domain name invalid.'; $wb["domain_error_autosub"] = 'There is already a subdomain with these settings.'; $wb["hd_quota_error_empty"] = 'Harddisk quota is 0 or empty.'; diff --git a/lib/lang/es_new_service_webdns.lng b/lib/lang/es_new_service_webdns.lng index d262973..fc14fcc 100755 --- a/lib/lang/es_new_service_webdns.lng +++ b/lib/lang/es_new_service_webdns.lng @@ -88,7 +88,8 @@ $wb['limit_database_txt'] = 'Ha alcanzado el número máx. de bases de dato.'; $wb['limit_dns_zone_txt'] = 'Ha alcanzado el número máx. de zonas DNS permitidos para su cuenta.'; $wb['apache_directives_txt'] = 'Directivas de Apache'; $wb['domain_error_empty'] = 'El dominio está vacío.'; -$wb['domain_error_unique'] = 'Ya existe un sitio web o sub/aliasdominio con este nombre de dominio.'; +$wb['domain_error_unique'] = 'Ya existe un sitio web o sub/aliasdominio con este nombre de dominio.'; +$wb['domain_error_unique_webdns'] = 'Ya existe una zona dns con este nombre de dominio.'; $wb['domain_error_regex'] = 'El nombre de dominio no es válido'; $wb['hd_quota_error_empty'] = 'Cuota de disco duro es 0 o vacío.'; $wb['traffic_quota_error_empty'] = 'Cuota de tráfico está vacío.'; diff --git a/new_service_webdns.php b/new_service_webdns.php index 6171ff0..d213582 100755 --- a/new_service_webdns.php +++ b/new_service_webdns.php @@ -1189,19 +1189,24 @@ class page_action extends tform_actions { function existeDominio($campos){ global $app, $conf; - if($app->db->queryOneRecord('SELECT * FROM dns_soa WHERE origin LIKE "'.$campos['domain'].'%"')) { - $app->tform->errorMessage = $app->tform->wordbook['domain_error_unique']; + //if($app->db->queryOneRecord('SELECT * FROM dns_soa WHERE origin LIKE "'.$campos['domain'].'%"')) { + if($app->db->queryOneRecord('SELECT * FROM dns_soa WHERE origin = "'.$campos['domain'].'."')) { + $app->tform->errorMessage = $app->tform->wordbook['domain_error_unique_webdns']; + $this->onError(); + return true; } if($app->db->queryOneRecord('SELECT domain_id, domain FROM web_domain WHERE domain = "'.$campos['domain'].'"')) { $app->tform->errorMessage = $app->tform->wordbook['error_sitio_web_existe']; + $this->onError(); + return true; } - if($app->tform->errorMessage) + /*if($app->tform->errorsMessage) { $this->onError(); return true; - } + }*/ } public $ip4_ultima;