From b573a7e52fe48249e03c0e4da4e748e6bdaf721b Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 5 May 2006 04:58:10 +0000 Subject: [PATCH] Added check departments, to avoid creating system reseverd departments git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3203 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/departments/class_departmentGeneric.inc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index b9e54e3ca..6d0343ade 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -224,10 +224,17 @@ class department extends plugin } /* Validate and modify - or: spaghetti rules! */ - if ($this->ou == "incoming"){ - $message[]= _("The field 'Name' contains the reserved word 'incoming'.". - " Please choose another name."); + $SkipNames = array( "incoming","apps","systems","fai","config", + preg_replace("/ou=(.*),/","\\1",get_people_ou()), + preg_replace("/ou=(.*),/","\\1",get_groups_ou()) + ); + foreach($SkipNames as $name){ + if ($this->ou == $name){ + $message[]= sprintf(_("The field 'Name' contains the reserved word '%s'. Please choose another name."),$name); + } } + + if (preg_match ('/[#+:=>\\\\\/]/', $this->ou)){ $message[]= _("The field 'Name' contains invalid characters."); } -- 2.30.2