Code

Updated roles
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Jul 2010 11:23:11 +0000 (11:23 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Jul 2010 11:23:11 +0000 (11:23 +0000)
-Allow special chars in role names

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19218 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/rolemanagement/admin/roleManagement/class_roleGeneric.inc
gosa-plugins/rolemanagement/admin/roleManagement/tabs_roles.inc

index 21190175401050560e9e297a15678ee38586bddf..a06f6600d9ed818d376511b8c0a60e1ee428875b 100644 (file)
@@ -278,9 +278,8 @@ class roleGeneric extends plugin {
             $message[]= msgPool::required(_("Name"));
         }
 
-       
-        if (preg_match("/[^a-z0-9]/i", $this->cn)){
-            $message[]= msgPool::invalid(_("Name"), $this->cn, '/[a-z0-9]/i');
+        if (preg_match ('/[#+:=>\\\\\/]/', $this->ou)){
+            $message[]= msgPool::invalid(_("Name"), $this->cn, "/[^#+:=>\\\\\/]/");
         }
 
         // Check if this name is uniq for roles.
index 98b3c00c38a6fa798b788d1df42a8cc75812d4dd..8346d9b1b55d226034ad499fbd75f95bf94d39d1 100644 (file)
@@ -55,7 +55,9 @@ class roletabs extends tabs
 
                /* Check for new 'dn', in order to propagate the
                   'dn' to all plugins */
-               $new_dn= 'cn='.$baseobject->cn.','.get_ou("roleGeneric", "roleRDN").$baseobject->base;
+        $nAV      = preg_replace('/,/', '\,', $baseobject->cn); 
+        $nAV      = preg_replace('/"/', '\"', $nAV); 
+               $new_dn= 'cn='.$nAV.','.get_ou("roleGeneric", "roleRDN").$baseobject->base;
 
                /* Move role? */
                if ($this->dn != $new_dn){