From: hickert Date: Thu, 15 Sep 2005 06:50:20 +0000 (+0000) Subject: Allowed - un givenName and sn X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=15da7a052a01667e95fc9ae720e5ee31072605ce;p=gosa.git Allowed - un givenName and sn disallow everything else as a-z0-9 for uid, git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1369 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 9f216a957..8749a6627 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -876,6 +876,10 @@ class user extends plugin /* Assemble cn */ $this->cn= $this->givenName." ".$this->sn; + if(preg_match("/[^a-z0-9]/",$this->uid)){ + $message[]=_("Invalid characters in uid.") ; + } + /* Permissions for that base? */ if (isset($this->config->current['DNMODE']) && $this->config->current['DNMODE'] == "uid"){ $new_dn= 'uid='.$this->uid.','.get_people_ou().$this->base; @@ -960,12 +964,12 @@ class user extends plugin } /* Check for reserved characers */ - if (preg_match ('/[,+"?\'()-=<>;]/', $this->givenName)){ + if (preg_match ('/[,+"?\'()=<>;]/', $this->givenName)){ $message[]= _("The field 'Given name' contains invalid characters."); - } - if (preg_match ('/[,+"?\'()-=<>;]/', $this->sn)){ - $message[]= _("The field 'Name' contains invalid characters."); - } + } + if (preg_match ('/[,+"?\'()=<>;]/', $this->sn)){ + $message[]= _("The field 'Name' contains invalid characters."); + } return $message; }