Marius Burkard
2016-07-10 e1ceb050e19c7574bca146a8da7047ee4ff456b5
interface/web/dns/dns_spf_edit.php
@@ -163,7 +163,7 @@
      }
      $spf_ip = trim($this->dataRecord['spf_ip']);
      if (!empty($spf_ip)) {
         $rec = split(' ', $spf_ip);
         $rec = explode(' ', $spf_ip);
         foreach ($rec as $ip) {
            $temp_ip = explode('/', $ip);
            if (filter_var($temp_ip[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
@@ -187,7 +187,7 @@
      }
      $spf_hostname = trim($this->dataRecord['spf_hostname']);
      if (!empty($spf_hostname)) {
         $rec = split(' ', $spf_hostname);
         $rec = explode(' ', $spf_hostname);
         foreach ($rec as $hostname) { 
            if (preg_match('/^[a-zA-Z0-9\\.\\-\\*]{0,64}$/', $hostname)) 
               $spf_record[] = 'a:' . $hostname;
@@ -200,7 +200,7 @@
      }
      $spf_domain = trim($this->dataRecord['spf_domain']);
      if (!empty($spf_domain)) {
         $rec = split(' ', $spf_domain);
         $rec = explode(' ', $spf_domain);
         foreach ($rec as $domain) {
            if (preg_match('/^[_a-zA-Z0-9\\.\\-\\*]{0,64}$/', $domain))
               $spf_record[] = 'include:' . $domain;
@@ -242,12 +242,12 @@
      //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
      $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $app->functions->intval($this->dataRecord["zone"]));
      $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
      $app->db->datalogUpdate('dns_rr', array("sys_groupid" => $soa['sys_groupid']), 'id', $this->id);
      //* Update the serial number of the SOA record
      $soa_id = $app->functions->intval($_POST["zone"]);
      $serial = $app->validate_dns->increase_serial($soa["serial"]);
      $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
      $app->db->datalogUpdate('dns_soa', array("serial" => $serial), 'id', $soa_id);
   }
@@ -258,7 +258,7 @@
      $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $app->functions->intval($this->dataRecord["zone"]));
      $soa_id = $app->functions->intval($_POST["zone"]);
      $serial = $app->validate_dns->increase_serial($soa["serial"]);
      $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
      $app->db->datalogUpdate('dns_soa', array("serial" => $serial), 'id', $soa_id);
   }
}