Code

Added support for missing double quotes
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 3 Nov 2009 11:31:29 +0000 (11:31 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 3 Nov 2009 11:31:29 +0000 (11:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14732 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_ldap.inc
gosa-core/plugins/admin/departments/tabs_department.inc

index 4b578a8f9f910fde6e4bc0d93a31ba7f1958e103..9b968fd9d91b79598919fbaa6c8e2a2114be5446 100644 (file)
@@ -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);
index c3d23e567c7873925630e60d783b99c297031206..47f9e7a509edf81bf8eaef97cca646acc911e59e 100644 (file)
@@ -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? */