Code

Added gosaLastSystemLogin attribute.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 18 Aug 2008 11:50:14 +0000 (11:50 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 18 Aug 2008 11:50:14 +0000 (11:50 +0000)
-Added attribute to user class and template.

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

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

index 08ba9015ccd611f515028f102dd4bc5a09c96e94..008390c28a9287eda194b8b53167158ce35c764c 100644 (file)
@@ -37,6 +37,12 @@ class user extends plugin
   var $plHeadline= "Generic";
   var $plDescription= "Edit organizational user settings";
 
+  /* 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= "";
@@ -140,6 +146,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->orig_dn  = $this->dn;
     $this->new_dn   = $dn;
 
@@ -251,6 +264,7 @@ class user extends plugin
     }
 
     $smarty= get_smarty();
+    $smarty->assign("gosaLastSystemLogin",$this->gosaLastSystemLogin);
 
     /* Fill calendar */
     if ($this->dateOfBirth == "0"){
index 5706d15259b44ea5698e916c23e772a28cc3488c..a1e95f071dc642b1eba0002a512124cc91f27fb9 100644 (file)
     </tr>
     {/if}
 
+       {if $gosaLastSystemLogin}
+               <tr>
+                       <td>{t}Last logon{/t}</td>
+                       <td>{$gosaLastSystemLogin}</td>
+               </tr>           
+       {/if}
    </table>
   </td>
  </tr>