summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 84b2d36)
raw | patch | inline | side by side (parent: 84b2d36)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 14 Feb 2008 08:34:31 +0000 (08:34 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 14 Feb 2008 08:34:31 +0000 (08:34 +0000) |
-getDNSZoneEntriesDiff also updates the reverse zone now.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@8898 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@8898 594d385d-05f5-0310-b6e9-bd551577e9d8
include/functions_dns.inc | patch | blob | history |
index e1cda20a0af871f8972d184bdf70ac72d122c6ce..9a62acf4c0a2c5da9720620c3c180febe2cb42e5 100644 (file)
/* Walk through all zones and detect renamed/added/deleted zones ...
*/
foreach($newZones as $name => $zone){
-
+
/* This zone was renamed
*/
if((!empty($zone['InitialzoneName'])) && ($zone['InitialzoneName'] != $zone['zoneName'])){
*/
$oldDn = "zoneName=".getNameFromMix($zone['InitialzoneName']).",".$HostDn;
$newDn = "zoneName=".getNameFromMix($zone['zoneName']).",".$HostDn;
- $PrePareZoneEntries[$zone['InitialzoneName']] = getNameFromMix($zone['zoneName']);
+ $PrePareZoneEntries[getNameFromMix($zone['InitialzoneName'])] = getNameFromMix($zone['zoneName']);
$move [$oldDn] = $newDn;
}
$base = "zoneName=".getNameFromMix($zone['zoneName']).",".$HostDn;
$oldRDn = "zoneName=". FlipIp(getNameFromMix($zone['InitialReverseZone'])).".in-addr.arpa,".$base;
$newRDn = "zoneName=". FlipIp(getNameFromMix($zone['ReverseZone'])).".in-addr.arpa,".$base;
- $PrePareZoneEntries[FlipIp($zone['InitialReverseZone']).".in-addr.arpa"] = FlipIp($zone['ReverseZone']).".in-addr.arpa";
+ $PrePareZoneEntries[FlipIp(getNameFromMix($zone['InitialReverseZone'])).".in-addr.arpa"] = FlipIp(getNameFromMix($zone['ReverseZone'])).".in-addr.arpa";
$move [$oldRDn] = $newRDn;
}
}
$udpate = array();
if(count($PrePareZoneEntries)){
$ldap = $config->get_ldap_link();
+
foreach($PrePareZoneEntries as $FromZoneName => $ToZoneName){
$ldap->cd($HostDn);
- $ldap->search("(&(objectClass=dNSZone)(zoneName=".getNameFromMix($FromZoneName).")(!(relativeDomainName=@)))",array("zoneName"));
+ $ldap->search("(&(objectClass=dNSZone)(zoneName=".$FromZoneName.")(!(relativeDomainName=@)))",array("zoneName"));
while($attrs = $ldap->fetch()){
- $zoneUpdates[$attrs['dn']] = array("zoneName"=>$ToZoneName);
+ $attr_to_change = array();
+ $attr_to_change['zoneName'] = $ToZoneName;
+ $zoneUpdates[$attrs['dn']] = $attr_to_change;
}
}
}
-
$ret = array("del" => $del , "move" => $move , "add" => $add,"zoneUpdates"=>$zoneUpdates);
return($ret);
}