Code

Added more allowed characters
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Jul 2007 14:05:20 +0000 (14:05 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Jul 2007 14:05:20 +0000 (14:05 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6852 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_ldap.inc
plugins/admin/departments/class_departmentGeneric.inc

index de12ef2a42395481df42a5b0a009114a8af6027a..04294325d4a263b086c1a88c54c05f753b092756 100644 (file)
@@ -59,14 +59,17 @@ class LDAP{
      Currently used codes:
       ,   => CO
       \2C => CO
+      \22 => TO
+      \"  => TO
+      \+  => PL
       (   => OB
       )   => CB
       /   => SL                                                                  */
   function convert($dn)
   {
     if (SPECIALS_OVERRIDE == TRUE){
-      $tmp= preg_replace(array("/\\\\,/", "/\\\\2C/", "/\(/", "/\)/", "/\//"),
-                           array("\001CO", "\001CO", "\001OB", "\001CB", "\001SL"),
+      $tmp= preg_replace(array("/\\\\,/", "/\\\\2C/", "/\(/", "/\)/", "/\//", "/\\\\22/", '/\\\\"/', "/\\\\3D/", "/\\\\2B/", '/\\\\+/'),
+                           array("\001CO", "\001CO", "\001OB", "\001CB", "\001SL", "\001TO", "\001TO", "\001GL", "\001PL", "\001PL"),
                            $dn);
       return (preg_replace('/,\s+/', ',', $tmp));
     } else {
@@ -82,8 +85,8 @@ class LDAP{
   function fix($dn)
   {
     if (SPECIALS_OVERRIDE == TRUE){
-      return (preg_replace(array("/\001CO/", "/\001OB/", "/\001CB/", "/\001SL/"),
-                           array("\,", "(", ")", "/"),
+      return (preg_replace(array("/\001CO/", "/\001OB/", "/\001CB/", "/\001SL/", "/\001TO/", "/\001PL/", "/\001GL/"),
+                           array("\,", "(", ")", "/", '\"', "\+", "="),
                            $dn));
     } else {
       return ($dn);
index fff1409070996671730f6765808274084c9c693b..9aecbccdff2cb3d39578dc59596a449b74e37625 100644 (file)
@@ -239,7 +239,7 @@ class department extends plugin
       $message[]= sprintf(_("The field 'Name' contains the reserved word '%s'. Please choose another name."),$this->ou);
     }
 
-               if (preg_match ('/["#+:=>\\\\\/]/', $this->ou)){
+               if (preg_match ('/["+>\\\\]/', $this->ou)){
                        $message[]= _("The field 'Name' contains invalid characters.");
                }
                if (!is_phone_nr($this->telephoneNumber)){