ftimme
2013-07-04 820e4a545e723976ce3f4ce0e57eef02f9b3cf7d
interface/web/dns/dns_slave_edit.php
@@ -123,7 +123,7 @@
      if($_SESSION["s"]["user"]["typ"] != 'admin') {
         // Get the limits of the client
         $client_group_id = $_SESSION["s"]["user"]["default_group"];
         $client = $app->db->queryOneRecord("SELECT limit_dns_slave_zone, default_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
         $client = $app->db->queryOneRecord("SELECT limit_dns_slave_zone, default_slave_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
      
         // When the record is updated
         if($this->id > 0) {
@@ -134,7 +134,7 @@
         // When the record is inserted
         } else {
            // set the server ID to the default dnsserver of the client
            $this->dataRecord["server_id"] = $client["default_dnsserver"];
            $this->dataRecord["server_id"] = $client["default_slave_dnsserver"];
            
            // Check if the user may add anoter secondary domain.
            if(!$app->tform->checkClientLimit('limit_dns_slave_zone')) {
@@ -158,6 +158,17 @@
      parent::onSubmit();
   }
   
   function onInsert() {
      global $app, $conf;
      // Check if record is existing already
      $duplicate_slave = $app->db->queryOneRecord("SELECT * FROM dns_slave WHERE origin = '".$this->dataRecord["origin"]."' AND server_id = ".$app->functions->intval($this->dataRecord["server_id"])." AND ".$app->tform->getAuthSQL('r'));
      if(is_array($duplicate_slave) && !empty($duplicate_slave)) $app->error($app->tform->wordbook["origin_error_unique"]);
      parent::onInsert();
   }
   function onAfterInsert() {
      global $app, $conf;