From 0eaa4a419b22f29e686e0723bada8efb9a800b54 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 18 Aug 2008 11:50:14 +0000 Subject: [PATCH] Added gosaLastSystemLogin attribute. -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 | 14 ++++++++++++++ gosa-core/plugins/personal/generic/generic.tpl | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc index 08ba9015c..008390c28 100644 --- a/gosa-core/plugins/personal/generic/class_user.inc +++ b/gosa-core/plugins/personal/generic/class_user.inc @@ -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"){ diff --git a/gosa-core/plugins/personal/generic/generic.tpl b/gosa-core/plugins/personal/generic/generic.tpl index 5706d1525..a1e95f071 100644 --- a/gosa-core/plugins/personal/generic/generic.tpl +++ b/gosa-core/plugins/personal/generic/generic.tpl @@ -246,6 +246,12 @@ {/if} + {if $gosaLastSystemLogin} + + {t}Last logon{/t} + {$gosaLastSystemLogin} + + {/if} -- 2.30.2