From efe4b144c805032b23350c211377551fdee057ea Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 18 Aug 2008 11:47:56 +0000 Subject: [PATCH] Added gosaLastSystemLogin attribute. -Added attribute to user class and template. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@12237 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/personal/generic/class_user.inc | 14 ++++++++++++++ plugins/personal/generic/generic.tpl | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 8993f4e40..12e96ec91 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -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"){ diff --git a/plugins/personal/generic/generic.tpl b/plugins/personal/generic/generic.tpl index f14794f16..786fdcadf 100644 --- a/plugins/personal/generic/generic.tpl +++ b/plugins/personal/generic/generic.tpl @@ -186,6 +186,12 @@ {/if} + {if $gosaLastSystemLogin} + + {t}Last logon{/t} + {$gosaLastSystemLogin} + + {/if} -- 2.30.2