Code

Added gosaLastSystemLogin attribute.
[gosa.git] / plugins / personal / generic / class_user.inc
index 8993f4e40dcf4dc2cb416a42dd02878492be7859..12e96ec915bc8ce5e1147222b2a7c168403437ae 100644 (file)
@@ -16,6 +16,12 @@ class user extends plugin
   var $plHeadline= "Generic";
   var $plDescription= "This does something";
 
+  /* The attribute gosaLastSystemLogin represents the timestamp of the last 
+      successfull login on the users workstation. 
+     Read the FAQ to get a hint about how to configure this.
+   */
+  var $gosaLastSystemLogin = "";
+
   /* Plugin specific values */
   var $base= "";
   var $orig_base= "";
@@ -111,6 +117,13 @@ class user extends plugin
     /* Load base attributes */
     plugin::plugin ($config, $dn);
 
+    /*  If gosaLastSystemLogin is available read it from ldap and create a readable 
+         date time string.
+     */
+    if(isset($this->attrs['gosaLastSystemLogin'][0]) && preg_match("/^[0-9]*$/",$this->attrs['gosaLastSystemLogin'][0])){
+      $this->gosaLastSystemLogin = date("d.m.Y H:i:s", $this->attrs['gosaLastSystemLogin'][0]);
+    }
+
     $this->new_dn = $dn;
 
     if ($this->config->current['GOVERNMENTMODE']){
@@ -213,6 +226,7 @@ class user extends plugin
     plugin::execute();
 
     $smarty= get_smarty();
+    $smarty->assign("gosaLastSystemLogin",$this->gosaLastSystemLogin);
 
     /* Fill calendar */
     if ($this->dateOfBirth == "0"){