summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3fdc591)
raw | patch | inline | side by side (parent: 3fdc591)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Aug 2007 10:16:26 +0000 (10:16 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Aug 2007 10:16:26 +0000 (10:16 +0000) |
Automatically add systems ptr record.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7144 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7144 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_termDNS.inc | patch | blob | history |
index de022df190782325ccd281775a946365edca00b5..52085344260c021228343d77ca7056f6106e7e77 100644 (file)
/* 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]);
}
+ if(($rec['type'] == "pTRRecord") && ($rec['value'] == $ptr)){
+ unset($this->dnsEntry['RECORDS'][$key]);
+ }
}
/* Get Record types
*/
if(!empty($this->ipHostNumber)){
$this->dnsEntry['RECORDS'][] = array("type"=>"aRecord","value"=>$this->ipHostNumber);
- $ldap->cat(getDNSZoneDN($this->config,$this->dnsEntry['zoneName']));
- $attrs = $ldap->fetch();
- $str = trim(preg_replace("/(^[^ ]*).*$/","\\1",$attrs['sOARecord'][0]));
- $this->dnsEntry['RECORDS'][] = array("type"=>"nsRecord","value"=>$str);
+ $ptr = $this->get_pTRRecord();
+ if(!empty($ptr)){
+ $this->dnsEntry['RECORDS'][] = array("type"=>"pTRRecord","value"=>$ptr);
+ }
}
/* Create diff and follow instructions
}
+ /* this function returns the default ptr record entry */
+ function get_pTRRecord()
+ {
+ if(!empty($this->ipHostNumber) && isset($this->dnsEntry['zoneName'])){
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cat(getDNSZoneDN($this->config,$this->dnsEntry['zoneName']));
+ $attrs = $ldap->fetch();
+ $tmp = array_flip($this->Zones);
+ $tmp = preg_replace("/^[^\/]*+\//","",$tmp[$this->dnsEntry['zoneName']]);
+ $tmp = trim(preg_replace("/\.in-addr.arpa$/","",$tmp));
+ $ptr = preg_replace("/^".normalizePreg(FlipIp($tmp))."\./","",$this->ipHostNumber);
+ return($ptr);
+ }else{
+ return(FALSE);
+ }
+ }
+
+
function create_tree($arr,$base,$current = "")
{
$ret = array();