From cd21a23b84b4d6f7beb7056ab5de057ca57629c7 Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 3 Nov 2009 11:31:29 +0000 Subject: [PATCH] Added support for missing double quotes git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14732 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_ldap.inc | 11 ++++++----- .../plugins/admin/departments/tabs_department.inc | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gosa-core/include/class_ldap.inc b/gosa-core/include/class_ldap.inc index 4b578a8f9..9b968fd9d 100644 --- a/gosa-core/include/class_ldap.inc +++ b/gosa-core/include/class_ldap.inc @@ -87,12 +87,13 @@ class LDAP{ \2C => CO ( => OB ) => CB - / => SL */ + / => SL + \22 => DQ */ static function convert($dn) { if (SPECIALS_OVERRIDE == TRUE){ - $tmp= preg_replace(array("/\\\\,/", "/\\\\2C/", "/\(/", "/\)/", "/\//"), - array("\001CO", "\001CO", "\001OB", "\001CB", "\001SL"), + $tmp= preg_replace(array("/\\\\,/", "/\\\\2C/", "/\(/", "/\)/", "/\//", "/\\\\22/", '/\\\\"/'), + array("\001CO", "\001CO", "\001OB", "\001CB", "\001SL", "\001DQ", "\001DQ"), $dn); return (preg_replace('/,\s+/', ',', $tmp)); } else { @@ -108,8 +109,8 @@ class LDAP{ static function fix($dn) { if (SPECIALS_OVERRIDE == TRUE){ - return (preg_replace(array("/\001CO/", "/\001OB/", "/\001CB/", "/\001SL/"), - array("\,", "(", ")", "/"), + return (preg_replace(array("/\001CO/", "/\001OB/", "/\001CB/", "/\001SL/", "/\001DQ/"), + array("\,", "(", ")", "/", '\"'), $dn)); } else { return ($dn); diff --git a/gosa-core/plugins/admin/departments/tabs_department.inc b/gosa-core/plugins/admin/departments/tabs_department.inc index c3d23e567..47f9e7a50 100644 --- a/gosa-core/plugins/admin/departments/tabs_department.inc +++ b/gosa-core/plugins/admin/departments/tabs_department.inc @@ -55,6 +55,7 @@ class deptabs extends tabs $baseobject= &$this->by_object[$this->base_name]; $namingAttr = $baseobject->namingAttr; $nAV = preg_replace('/,/', '\,', $baseobject->$namingAttr); + $nAV = preg_replace('/"/', '\"', $nAV); $new_dn = @LDAP::convert($namingAttr.'='.$nAV.','.$baseobject->base); /* Move group? */ -- 2.30.2