Code

Fixed gecos field which is not utf-8 conform
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Aug 2005 06:08:05 +0000 (06:08 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Aug 2005 06:08:05 +0000 (06:08 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1192 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/posix/class_posixAccount.inc

index 11463b41322cd2b5f0677c22c7072386f2b31868..f49106f4a11a5d7291569a809244d0943e0ef71b 100644 (file)
@@ -748,7 +748,10 @@ class posixAccount extends plugin
 
     /* Fill gecos */
     if (isset($this->parent) && $this->parent != NULL){
-      $this->gecos= $this->parent->by_object['user']->cn;
+      $this->gecos= rewrite($this->parent->by_object['user']->cn);
+         if (!preg_match('/[a-z0-9 -]/i', $this->gecos)){
+                 $this->gecos= "";
+         }
     }
 
     /* Call parents save to prepare $this->attrs */