| @@ -129,7 +129,7 @@ class limites { | |||||
| if($this->cliente['parent_client_id'] != 0) { | if($this->cliente['parent_client_id'] != 0) { | ||||
| $this->getRevendedor(); | $this->getRevendedor(); | ||||
| //echo(' Valores '.$this->revendedor . ' otro ' . $this->revendedor_grupos . ' y otro ' .$this->revendedor_grupo_def); | |||||
| //echo(' Revendedor es '.$this->revendedor . ' reven grupos ' . $this->revendedor_grupos . ' y reven grupo def ' .$this->revendedor_grupo_def); | |||||
| //echo(' El cliente es ' . $this->cliente['parent_client_id']); | //echo(' El cliente es ' . $this->cliente['parent_client_id']); | ||||
| $reseller = $app->db->queryOneRecord( | $reseller = $app->db->queryOneRecord( | ||||
| "SELECT limit_dns_zone as number, contact_name FROM client WHERE client_id = ?", $this->cliente['parent_client_id']); | "SELECT limit_dns_zone as number, contact_name FROM client WHERE client_id = ?", $this->cliente['parent_client_id']); | ||||
| @@ -143,7 +143,7 @@ class limites { | |||||
| "SELECT count(id) as number FROM dns_soa WHERE sys_groupid = ?", $this->revendedor_grupo_def); | "SELECT count(id) as number FROM dns_soa WHERE sys_groupid = ?", $this->revendedor_grupo_def); | ||||
| $totalCreado = $tmpCliente['number'] + $tmpReventa['number']; | $totalCreado = $tmpCliente['number'] + $tmpReventa['number']; | ||||
| if($totalCreado >= $reseller['number']) { | if($totalCreado >= $reseller['number']) { | ||||
| $app->error($reseller['contact_name'] . '. ' . $app->tform->wordbook["limit_dns_zone_txt"]); | $app->error($reseller['contact_name'] . '. ' . $app->tform->wordbook["limit_dns_zone_txt"]); | ||||
| return true; | return true; | ||||
| @@ -154,18 +154,19 @@ class limites { | |||||
| $this->esRevendedor(); | $this->esRevendedor(); | ||||
| if($this->esReventa){ | if($this->esReventa){ | ||||
| $sumaTotal = 0; | |||||
| foreach($this->todosLosGrupos as $grupos) { | |||||
| $tmpReventaALL = $app->db->queryOneRecord( | |||||
| "SELECT count(id) as number FROM dns_soa WHERE sys_groupid = ?", $grupos); | |||||
| $sumaTotal += $tmpReventaALL['number']; | |||||
| } | |||||
| //echo(' La suma ' . $sumaTotal . ' limite ' . $this->cliente["limit_dns_zone"]); | |||||
| if($sumaTotal >= $this->cliente["limit_dns_zone"]) { | |||||
| $app->error($this->esReventa['contact_name'] . '. ' . $app->tform->wordbook["limit_dns_zone_txt"]); | |||||
| return true; | |||||
| //Si el reventa tiene límites los cotejamos. | |||||
| if($this->cliente["limit_dns_zone"] >= 0){ | |||||
| $sumaTotal = 0; | |||||
| foreach($this->todosLosGrupos as $grupos) { | |||||
| $tmpReventaALL = $app->db->queryOneRecord( | |||||
| "SELECT count(id) as number FROM dns_soa WHERE sys_groupid = ?", $grupos); | |||||
| $sumaTotal += $tmpReventaALL['number']; | |||||
| } | |||||
| if($sumaTotal >= $this->cliente["limit_dns_zone"]) { | |||||
| $app->error($this->esReventa['contact_name'] . '. ' . $app->tform->wordbook["limit_dns_zone_txt"]. ' aquí.'); | |||||
| return true; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| @@ -215,18 +216,20 @@ class limites { | |||||
| $this->esRevendedor(); | $this->esRevendedor(); | ||||
| if($this->esReventa){ | if($this->esReventa){ | ||||
| $sumaTotal = 0; | |||||
| foreach($this->todosLosGrupos as $grupos) { | |||||
| $tmpReventaALL = $app->db->queryOneRecord( | |||||
| "SELECT count(domain_id) as number FROM web_domain | |||||
| WHERE sys_groupid = ? and type = 'vhost'", $grupos); | |||||
| $sumaTotal += $tmpReventaALL['number']; | |||||
| } | |||||
| if($sumaTotal >= $this->cliente["limit_web_domain"]) { | |||||
| $app->error($this->esReventa['contact_name'] . '. ' . $app->tform->wordbook["limit_web_domain_txt"]); | |||||
| return true; | |||||
| //Si el reventa tiene límites los cotejamos. | |||||
| if($this->cliente["limit_web_domain"] >= 0){ | |||||
| $sumaTotal = 0; | |||||
| foreach($this->todosLosGrupos as $grupos) { | |||||
| $tmpReventaALL = $app->db->queryOneRecord( | |||||
| "SELECT count(domain_id) as number FROM web_domain | |||||
| WHERE sys_groupid = ? and type = 'vhost'", $grupos); | |||||
| $sumaTotal += $tmpReventaALL['number']; | |||||
| } | |||||
| if($sumaTotal >= $this->cliente["limit_web_domain"]) { | |||||
| $app->error($this->esReventa['contact_name'] . '. ' . $app->tform->wordbook["limit_web_domain_txt"]); | |||||
| return true; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| @@ -276,18 +279,20 @@ class limites { | |||||
| $this->esRevendedor(); | $this->esRevendedor(); | ||||
| if($this->esReventa){ | if($this->esReventa){ | ||||
| $sumaTotal = 0; | |||||
| foreach($this->todosLosGrupos as $grupos) { | |||||
| $tmpReventaALL = $app->db->queryOneRecord( | |||||
| "SELECT count(database_id) as number | |||||
| FROM web_database WHERE sys_groupid = ?", $grupos); | |||||
| $sumaTotal += $tmpReventaALL['number']; | |||||
| } | |||||
| if($sumaTotal >= $this->cliente["limit_database"]) { | |||||
| $app->error($this->esReventa['contact_name'] . '. ' . $app->tform->wordbook["limit_database_txt"]); | |||||
| return true; | |||||
| //Si el reventa tiene límites los cotejamos. | |||||
| if($this->cliente["limit_database"] >= 0){ | |||||
| $sumaTotal = 0; | |||||
| foreach($this->todosLosGrupos as $grupos) { | |||||
| $tmpReventaALL = $app->db->queryOneRecord( | |||||
| "SELECT count(database_id) as number | |||||
| FROM web_database WHERE sys_groupid = ?", $grupos); | |||||
| $sumaTotal += $tmpReventaALL['number']; | |||||
| } | |||||
| if($sumaTotal >= $this->cliente["limit_database"]) { | |||||
| $app->error($this->esReventa['contact_name'] . '. ' . $app->tform->wordbook["limit_database_txt"]); | |||||
| return true; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||