X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Fadmin%2Fdepartments%2Fclass_departmentGeneric.inc;h=64d631deb83355f3e6e9d874f50cdac520e24764;hb=78ff273400c1bfc84cfea5ce4f338349602fe8f2;hp=df8c51e78fba7c40606b8c74a0adce06897cbea5;hpb=64666111bd2f20f4d23d3a55a0346280014990e5;p=gosa.git diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index df8c51e78..64d631deb 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -236,17 +236,9 @@ class department extends plugin $message[]= _("Required field 'Description' is not set."); } - /* Validate and modify - or: spaghetti rules! */ - $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(is_department_name_reserved($this->ou,$this->base)){ + $message[]= sprintf(_("The field 'Name' contains the reserved word '%s'. Please choose another name."),$this->ou); + } if (preg_match ('/[#+:=>\\\\\/]/', $this->ou)){ $message[]= _("The field 'Name' contains invalid characters.");