Code

Updated template adaption
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Jul 2010 13:03:58 +0000 (13:03 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Jul 2010 13:03:58 +0000 (13:03 +0000)
-DateOfBirth wasn't adapted correctly, even when it doesn't makes sense to adapt the dob.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19038 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/personal/generic/class_user.inc

index 9d8cae186e0e58269e4f1bf9d3aeb60e3f5f9d02..f66b36acb513bbd3eca10bbadf05dcef1b5f8094 100644 (file)
@@ -1551,12 +1551,15 @@ class user extends plugin
       $this->givenName= $this->parent->givenName;
     }
 
-    if ($this->dateOfBirth) {
+    /* Generate dateOfBirth entry */
+    if (isset ($this->attrs['dateOfBirth'])){
       /* This entry is ISO 8601 conform */
-      list($year, $month, $day)= explode("-", $this->dateOfBirth, 3);
+      list($year, $month, $day)= explode("-", $this->attrs['dateOfBirth'][0], 3);
     
       #TODO: use $lang to convert date
       $this->dateOfBirth= "$day.$month.$year";
+    } else {
+      $this->dateOfBirth= "";
     }
   }