From: cajus Date: Thu, 3 Sep 2009 10:29:06 +0000 (+0000) Subject: Added last system login X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3ca831d550935a942c4e6bb396a8948a30b4371e;p=gosa.git Added last system login git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14203 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc index 308567239..68866fa5b 100644 --- a/gosa-core/plugins/personal/posix/class_posixAccount.inc +++ b/gosa-core/plugins/personal/posix/class_posixAccount.inc @@ -67,6 +67,7 @@ class posixAccount extends plugin var $activate_shadowExpire= "0"; var $mustchangepassword= "0"; var $force_ids= 0; + var $gotoLastSystemLogin= ""; var $group_dialog= FALSE; var $show_ws_dialog= FALSE; var $secondaryGroups= array(); @@ -92,7 +93,7 @@ class posixAccount extends plugin var $attributes = array("homeDirectory", "loginShell", "uidNumber", "gidNumber", "gecos", "shadowMin", "shadowMax", "shadowWarning", "shadowInactive", "shadowLastChange", - "shadowExpire", "gosaDefaultPrinter", "uid","accessTo","trustModel"); + "shadowExpire", "gosaDefaultPrinter", "uid","accessTo","trustModel", "gotoLastSystemLogin"); var $objectclasses= array("posixAccount", "shadowAccount"); @@ -112,6 +113,15 @@ class posixAccount extends plugin /* Load bases attributes */ plugin::plugin($config, $dn); + /* If gotoLastSystemLogin is available read it from ldap and create a readable + 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", 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]); + } + /* Setting uid to default */ if(isset($this->attrs['uid'][0])){ $this->uid = $this->attrs['uid'][0]; @@ -519,6 +529,9 @@ class posixAccount extends plugin $smarty->assign("mustchangepasswordACL", $this->getacl("mustchangepassword",$SkipWrite)); } + // Set last system login + $smarty->assign("gotoLastSystemLogin",$this->gotoLastSystemLogin); + /* Fill calendar */ /* If this $this->shadowExpire is empty use current date as base for calculating selectbox values. diff --git a/gosa-core/plugins/personal/posix/generic.tpl b/gosa-core/plugins/personal/posix/generic.tpl index a02e385f4..605849096 100644 --- a/gosa-core/plugins/personal/posix/generic.tpl +++ b/gosa-core/plugins/personal/posix/generic.tpl @@ -36,6 +36,12 @@ {t}Status{/t} {$status} +{if $gotoLastSystemLogin} + + {t}Last logon{/t} + {$gotoLastSystemLogin} + +{/if} {/if}