From 2bf53e4de2eed9c029181ae171604119856c8c5b Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 29 Jul 2010 11:23:11 +0000 Subject: [PATCH] Updated roles -Allow special chars in role names git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19218 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/roleManagement/class_roleGeneric.inc | 5 ++--- .../rolemanagement/admin/roleManagement/tabs_roles.inc | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gosa-plugins/rolemanagement/admin/roleManagement/class_roleGeneric.inc b/gosa-plugins/rolemanagement/admin/roleManagement/class_roleGeneric.inc index 211901754..a06f6600d 100644 --- a/gosa-plugins/rolemanagement/admin/roleManagement/class_roleGeneric.inc +++ b/gosa-plugins/rolemanagement/admin/roleManagement/class_roleGeneric.inc @@ -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. diff --git a/gosa-plugins/rolemanagement/admin/roleManagement/tabs_roles.inc b/gosa-plugins/rolemanagement/admin/roleManagement/tabs_roles.inc index 98b3c00c3..8346d9b1b 100644 --- a/gosa-plugins/rolemanagement/admin/roleManagement/tabs_roles.inc +++ b/gosa-plugins/rolemanagement/admin/roleManagement/tabs_roles.inc @@ -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){ -- 2.30.2