Sergio Cambra
2014-07-09 3e94c8b7d989a3964a8d0d7c916292d28b9bd0ad
interface/web/dns/dns_slave_edit.php
@@ -72,6 +72,14 @@
   function onShowEnd() {
      global $app, $conf;
      $app->uses('ini_parser,getconf');
      $settings = $app->getconf->get_global_config('domains');
      /*
       * Now we have to check, if we should use the domain-module to select the domain
       * or not
       */
      if ($settings['use_domain_module'] != 'y') {
      // If user is admin, we will allow him to select to whom this record belongs
      if($_SESSION["s"]["user"]["typ"] == 'admin') {
         // Getting Domains of the user
@@ -108,14 +116,7 @@
            $app->tpl->setVar("client_group_id", $client_select);
         }
      /*
       * Now we have to check, if we should use the domain-module to select the domain
       * or not
       */
      $app->uses('ini_parser,getconf');
      $settings = $app->getconf->get_global_config('domains');
      if ($settings['use_domain_module'] == 'y') {
      } else {
         /*
          * The domain-module is in use.
         */
@@ -160,6 +161,9 @@
      $app->uses('ini_parser,getconf');
      $settings = $app->getconf->get_global_config('domains');
      if ($settings['use_domain_module'] == 'y') {
         if ($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
            $this->dataRecord['client_group_id'] = $app->tools_sites->getClientIdForDomain($this->dataRecord['origin']);
         }
         $domain_check = $app->tools_sites->checkDomainModuleDomain($this->dataRecord['origin']);
         if(!$domain_check) {
            // invalid domain selected