| @@ -9,7 +9,9 @@ Clase para el control de los límites de los usuarios con el módulo WebDNS. | |||||
| require_once '../../lib/app.inc.php'; | require_once '../../lib/app.inc.php'; | ||||
| global $app; | |||||
| //Carga de idioma para el texto de error de los límites DNS para el cliente | |||||
| $app->load_language_file('/web/dns/lib/lang/'.$_SESSION['s']['language'].'_dns_wizard.lng'); | |||||
| $app->uses('tform,tform_actions'); | $app->uses('tform,tform_actions'); | ||||
| $app->load('tform_actions'); | $app->load('tform_actions'); | ||||
| @@ -30,6 +32,39 @@ class limites { | |||||
| $this->cliente_grupo_id = $cliente_group_id; | $this->cliente_grupo_id = $cliente_group_id; | ||||
| } | } | ||||
| public function limitesLoad(){ | |||||
| global $app; | |||||
| //Límites DNS | |||||
| //Es necesario cargar estos valores en el formulario para que funcione la comprobación de los límites para el cliente | |||||
| $app->tform->formDef['db_table_idx'] = 'id'; | |||||
| $app->tform->formDef['db_table'] = 'dns_soa'; | |||||
| if(!$app->tform->checkClientLimit('limit_dns_zone')) { | |||||
| $app->error($app->lng('limit_dns_zone_txt')); | |||||
| } | |||||
| if(!$app->tform->checkResellerLimit('limit_dns_zone')) { | |||||
| $app->error('Reseller: '.$app->lng('limit_dns_zone_txt')); | |||||
| } | |||||
| //Límites BBDD | |||||
| if(!$app->tform->checkClientLimit('limit_database')) { | |||||
| $app->error($app->tform->wordbook["limit_database_txt"]); | |||||
| } | |||||
| if(!$app->tform->checkResellerLimit('limit_database')) { | |||||
| $app->error('Reseller: '.$app->tform->wordbook["limit_database_txt"]); | |||||
| } | |||||
| //Límites Sitios Web | |||||
| if(!$app->tform->checkClientLimit('limit_web_domain')) { | |||||
| $app->error($app->tform->wordbook["limit_web_domain_txt"]); | |||||
| } | |||||
| if(!$app->tform->checkResellerLimit('limit_web_domain')) { | |||||
| $app->error('Reseller: '.$app->tform->wordbook["limit_web_domain_txt"]); | |||||
| } | |||||
| } | |||||
| public $revendedor; | public $revendedor; | ||||
| public $revendedor_grupos; | public $revendedor_grupos; | ||||
| public $revendedor_grupo_def; | public $revendedor_grupo_def; | ||||
| @@ -19,12 +19,6 @@ $tform_def_file = "form/new_service_webdns.tform.php"; | |||||
| //Check permissions for module | //Check permissions for module | ||||
| $app->auth->check_module_permissions('webdns'); | $app->auth->check_module_permissions('webdns'); | ||||
| //Check the module permissions and redirect if not allowed. | |||||
| /*if(!stristr($_SESSION['s']['user']['modules'],'customdns')) { | |||||
| header('Location: ../index.php'); | |||||
| die; | |||||
| }*/ | |||||
| //Loading classes a usar. | //Loading classes a usar. | ||||
| $app->uses('tpl,tform,tform_actions,remoting,tools_sites,remoting_lib,remoting_dns'); | $app->uses('tpl,tform,tform_actions,remoting,tools_sites,remoting_lib,remoting_dns'); | ||||
| $app->load('tform_actions'); | $app->load('tform_actions'); | ||||
| @@ -32,17 +26,17 @@ $app->load('tform_actions'); | |||||
| class page_action extends tform_actions { | class page_action extends tform_actions { | ||||
| function onShowNew() { | |||||
| global $app; | |||||
| function onShowNew() { | |||||
| //global $app; | |||||
| // we will check only users, not admins | // we will check only users, not admins | ||||
| if($_SESSION['s']['user']['typ'] == 'user') { | if($_SESSION['s']['user']['typ'] == 'user') { | ||||
| if(!$app->tform->checkClientLimit('limit_database_user')) { | |||||
| $app->error($app->tform->wordbook["limit_database_user_txt"]); | |||||
| } | |||||
| if(!$app->tform->checkResellerLimit('limit_database_user')) { | |||||
| $app->error('Reseller: '.$app->tform->wordbook["limit_database_user_txt"]); | |||||
| } | |||||
| $client_group_id = $_SESSION["s"]["user"]["default_group"]; | |||||
| $limitado = new limites($client_group_id); | |||||
| $limitado->limitesLoad(); | |||||
| } | } | ||||
| parent::onShowNew(); | parent::onShowNew(); | ||||
| } | } | ||||
| @@ -1464,6 +1458,13 @@ print "<pre>IP6 WEB ";print_r($this->ip6_servidor_web);print "</pre>\n";*/ | |||||
| function onSubmit() { | function onSubmit() { | ||||
| global $app, $conf; | global $app, $conf; | ||||
| $sesionesLog = $_SESSION["s"]["user"]["typ"]; | |||||
| $sesionesLog2 = $_SESSION["s"]["user"]; | |||||
| $sesiones = $_SESSION; | |||||
| //print_r($sesiones); | |||||
| //print_r($sesionesLog2); | |||||
| if($this->plantillaWebDNS()){ | if($this->plantillaWebDNS()){ | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -6,14 +6,6 @@ | |||||
| </div> | </div> | ||||
| <!--div class="form-group"> | |||||
| <label class="col-sm-3 control-label" for="client_no_id">{tmpl_var name='client_id_txt'}</label> | |||||
| <div class="col-sm-9"> | |||||
| <select class="form-control" id="client_no_id" name="client_no_id"> | |||||
| {tmpl_var name='client_no_id'} | |||||
| </select> | |||||
| </div> | |||||
| </div--> | |||||
| <tmpl_if name="is_admin"> | <tmpl_if name="is_admin"> | ||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label for="client_group_id" class="col-sm-3 control-label">{tmpl_var name='client_txt'}</label> | <label for="client_group_id" class="col-sm-3 control-label">{tmpl_var name='client_txt'}</label> | ||||