diff --git a/gosa-plugins/systems/admin/systems/class_termDNS.inc b/gosa-plugins/systems/admin/systems/class_termDNS.inc
index 4ceb6fbcb486c0437c95d8e1776d295f1e6497dd..c3806820105ab012dc51e1928edf2d20c0de74eb 100644 (file)
*/
$this->dnsEntry = DNS::getDNSHostEntries($config,$this->OrigCn);
+ $ptr = DNS::FlipIp($this->get_pTRRecord());
+
/* Remove A record which equals $this->ipHostNumber
*/
- $ptr = $this->get_pTRRecord();
foreach($this->dnsEntry['RECORDS'] as $key => $rec){
if(($rec['type'] == "aRecord") && ($rec['value'] == $this->ipHostNumber)){
unset($this->dnsEntry['RECORDS'][$key]);
function netmaskIsCoherent($idZone)
{
- $netmask = DNS::FlipIp(str_replace(".in-addr.arpa","",DNS::getNameFromMix($idZone)));
+ $netmask = DNS::FlipIp(str_replace(".in-addr.arpa.","",DNS::getNameFromMix($idZone)));
if(!strstr($this->ipHostNumber, $netmask)){
return false;
}else{
if(isset($_POST['propose_ip']) && $this->acl_is_writeable("ipHostNumber")){
foreach($this->Zones as $key => $name){
if($name == $this->dnsEntry['zoneName']){
- $net = DNS::FlipIp(str_replace(".in-addr.arpa","",DNS::getNameFromMix($key)));
+ $net = DNS::FlipIp(str_replace(".in-addr.arpa.","",DNS::getNameFromMix($key)));
$this->ipHostNumber = $this->generateRandomIP($net);
}
}
$this->dnsEntry['exists'] = $this->DNS_is_account;
$tmp = DNS::getDNSHostEntriesDiff($this->config,$this->OrigCn,$this->dnsEntry,$this->cn);
}
+
+ /* Update SOA record if needed
+ */
+ $this->updateSOARecord();
/* move follwoing entries
*/
$attrs = $ldap->fetch();
$tmp = array_flip($this->Zones);
$tmp = preg_replace("/^[^\/]*+\//","",$tmp[$this->dnsEntry['zoneName']]);
- $tmp = trim(preg_replace("/\.in-addr.arpa$/","",$tmp));
+ $tmp = trim(preg_replace("/\.in-addr.arpa\.$/","",$tmp));
$ptr = preg_replace("/^".preg_quote(DNS::FlipIp($tmp), '/')."\./","",$this->ipHostNumber);
return($ptr);
}else{
}
}
}
+
+ function updateSOARecord()
+ {
+ $oldEntries = DNS::getDNSHostEntries($this->config,$this->OrigCn);
+ $newEntries = $this->dnsEntry;
+ if(array_differs($newEntries['RECORDS'],$oldEntries['RECORDS'])){
+ DNS::touchDNSZone($this->config,$this->dnsEntry['zoneName']);
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: