From a5ef7cbeb291f4e5d234627453e18f2985e01bc6 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 4 Nov 2008 15:47:20 +0000 Subject: [PATCH] Updated rename && class ldap to allow to rename objects with ',' in their name git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12902 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_ldap.inc | 9 +++------ gosa-core/include/class_plugin.inc | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/gosa-core/include/class_ldap.inc b/gosa-core/include/class_ldap.inc index c7fa31f98..a0c46a7cc 100644 --- a/gosa-core/include/class_ldap.inc +++ b/gosa-core/include/class_ldap.inc @@ -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); diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index dee53fbb0..95abb82d8 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -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())); -- 2.30.2