Code

Updated rename && class ldap to allow to rename objects with ',' in their name
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Nov 2008 15:47:20 +0000 (15:47 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Nov 2008 15:47:20 +0000 (15:47 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12902 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_ldap.inc
gosa-core/include/class_plugin.inc

index c7fa31f98107ead05b1d608a7788445adb442777..a0c46a7cc6de9d16ee098c506bd0b41569e23df7 100644 (file)
@@ -461,9 +461,6 @@ class LDAP{
    */
   function rename_dn($source,$dest)
   {
-    $source = LDAP::fix($source);
-    $dest = LDAP::fix($dest);
-
     /* Check if source and destination are the same entry */
     if(strtolower($source) == strtolower($dest)){
       trigger_error("Source and destination can't be the same entry.");
@@ -483,9 +480,9 @@ class LDAP{
          parent   =>  ou=department,dc=...
          dest_rdn =>  cn=herbert
      */
-    $parent   = preg_replace("/^[^,]+,/","",$dest);
-    $dest_rdn = preg_replace("/,.*$/","",$dest);
-  
+    $parent   = @LDAP::fix(preg_replace("/^[^,]+,/","", @LDAP::convert($dest)));
+    $dest_rdn = @LDAP::fix(preg_replace("/,.*$/","",@LDAP::convert($dest)));
+
     if($this->hascon){
       if ($this->reconnect) $this->connect();
       $r= ldap_rename($this->cid,$source,$dest_rdn,$parent,TRUE); 
index dee53fbb0e430cf55c139e40fba865d2404c849c..95abb82d8865340d6565f5fd9f85ea6fbb67e250 100644 (file)
@@ -912,7 +912,7 @@ class plugin
     /* Try to move the source entry to the destination position */
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
-    $ldap->create_missing_trees(preg_replace("/^[^,]+,/","",$dst_dn));
+    $ldap->create_missing_trees(preg_replace("/^[^,]+,/","",@LDAP::convert($dst_dn)));
 
     if (!$ldap->rename_dn($src_dn,$dst_dn)){
       msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $src_dn, "", get_class()));