summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a8ccfb9)
raw | patch | inline | side by side (parent: a8ccfb9)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 13 Aug 2007 08:23:10 +0000 (08:23 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 13 Aug 2007 08:23:10 +0000 (08:23 +0000) |
Save changes made on dns plugin to current dn.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7044 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7044 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_servDNS.inc | patch | blob | history | |
plugins/admin/systems/class_servGeneric.inc | patch | blob | history |
index f12ad0f8bcc77f0de704d79532a6409e11fbbd93..362fb6448ca98b2caff758a9cdfa414ad4a57fcb 100644 (file)
if($old_dn == "new"){
$old_dn = $this->dn;
}
-
+
+ /* Update dns to current object dn */
$tmp = getDNSZoneEntriesDiff($this->config,$this->Zones,$old_dn);
+ $tmp2 = array();
+ foreach($tmp as $key1 => $data1){
+ $tmp2[$key1] = array();
+ foreach($data1 as $key2 => $data2){
+ $tmp2[$key1][preg_replace("/".normalizePreg($old_dn)."$/",$this->dn,$key2)] = $data2;
+ }
+ }
+ $tmp = $tmp2;
/* Updated zone entries if reverser or forward name has changed
* Must be done before moving entries, else the given dn is invalid
foreach($tmp['add'] as $dn => $attrs){
$ldap->cd($dn);
$ldap->cat($dn, array('dn'));
- if(count($ldap->fetch())){
+ if($ldap->count()){
$ldap->cd($dn);
$ldap->modify ($attrs);
+ show_ldap_error($ldap->get_error(), _("Saving DNS entries failed"));
}else{
$ldap->cd($dn);
$ldap->add($attrs);
+ show_ldap_error($ldap->get_error(), _("Saving DNS entries failed"));
}
- show_ldap_error($ldap->get_error(), _("Saving DNS entries failed"));
}
}
}
diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc
index fc3a089e6d04d1dbf8ed39c37a0e9c210786ad38..c0f824bc4dfa1b66d90ae0e61327fb75c6fd0cb9 100644 (file)
}
}else{
if ($this->orig_dn != $this->dn){
- $this->move($this->orig_dn, $this->dn);
+ $this->recursive_move($this->orig_dn, $this->dn);
plugin::save();
}
}