From 036d961276eb550931be567bf4213da7b1f30bfa Mon Sep 17 00:00:00 2001 From: psc Date: Sun, 21 Jun 2009 19:45:04 +0000 Subject: [PATCH] Apply patch for #225 by mba - Properly handle renaming of systems that contain special characters - Properly capture object group membership when editing systems git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13750 594d385d-05f5-0310-b6e9-bd551577e9d8 --- trunk/gosa-core/include/class_ldap.inc | 5 ++++- trunk/gosa-core/include/class_plugin.inc | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/trunk/gosa-core/include/class_ldap.inc b/trunk/gosa-core/include/class_ldap.inc index bcf06951d..126325661 100644 --- a/trunk/gosa-core/include/class_ldap.inc +++ b/trunk/gosa-core/include/class_ldap.inc @@ -120,7 +120,10 @@ class LDAP{ requests. I.e. member=.... */ static function prepare4filter($dn) { - return normalizeLdap(str_replace('\\\\', '\\\\\\', LDAP::fix($dn))); + $str = normalizeLdap(str_replace('\\\\', '\\\\\\', LDAP::fix($dn))); + /* Special-case '\,' for filters */ + $str = str_replace('\\,', '\\5C2C', $str); + return $str; } diff --git a/trunk/gosa-core/include/class_plugin.inc b/trunk/gosa-core/include/class_plugin.inc index 1c57be2cc..d1acf6346 100644 --- a/trunk/gosa-core/include/class_plugin.inc +++ b/trunk/gosa-core/include/class_plugin.inc @@ -954,6 +954,7 @@ class plugin /* Walk through all objectGroups and check if there are members matching the source dn */ + $src_dn=str_replace('\\,', '\\2C', LDAP::fix($src_dn)); foreach($ogroups as $ogroup){ if(isset($ogroup['member'])){ @@ -972,7 +973,9 @@ class plugin $o_ogroup = new ogroup($this->config,$ogroup['dn']); } - unset($o_ogroup->member[$c_mem]); + /* Members are stored with their converted names, so convert $c_mem as well + to have it match in case of special characters in its name. */ + unset($o_ogroup->member[LDAP::convert($c_mem)]); $o_ogroup->member[$d_mem]= $d_mem; } } -- 2.30.2