Code

Fix for gotoLastSystemLogin Format, fallback to sambaLogonTime if available.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Jun 2009 16:32:53 +0000 (16:32 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Jun 2009 16:32:53 +0000 (16:32 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13704 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index adb14ec187f78990f27c46501a61455a6cafebcc..95b0960a776688278cf228970058fa87b9e66f37 100644 (file)
@@ -147,10 +147,12 @@ class user extends plugin
     plugin::plugin ($config, $dn);
 
     /*  If gotoLastSystemLogin is available read it from ldap and create a readable
-        date time string.
+        date time string, fallback to sambaLogonTime if available.
      */
     if(isset($this->attrs['gotoLastSystemLogin'][0]) && preg_match("/^[0-9]*$/",$this->attrs['gotoLastSystemLogin'][0])){
-      $this->gotoLastSystemLogin = date("d.m.Y H:i:s", $this->attrs['gotoLastSystemLogin'][0]);
+      $this->gotoLastSystemLogin = date("d.m.Y H:i:s", strtotime($this->attrs['gotoLastSystemLogin'][0]));
+    } else if(isset($this->attrs['sambaLogonTime'][0]) && preg_match("/^[0-9]*$/",$this->attrs['sambaLogonTime'][0])){
+      $this->gotoLastSystemLogin = date("d.m.Y H:i:s", $this->attrs['sambaLogonTime'][0]);
     }
 
     $this->orig_dn  = $this->dn;