Code

Allowed - un givenName and sn
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 15 Sep 2005 06:50:20 +0000 (06:50 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 15 Sep 2005 06:50:20 +0000 (06:50 +0000)
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

plugins/personal/generic/class_user.inc

index 9f216a9575fa82dec047d274cdf18a5de813796d..8749a6627732d72e5c1382e93800841d88b27d0b 100644 (file)
@@ -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;
   }