mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-10-17 05:22:23 +00:00
show last access in online users only to admins
This commit is contained in:
parent
dd94898b19
commit
ab141b84df
|
@ -45,6 +45,7 @@ class SeedDMS_View_Session extends SeedDMS_Bootstrap_Style {
|
|||
$user = $this->params['user'];
|
||||
|
||||
$sessionmgr = new SeedDMS_SessionMgr($dms->getDB());
|
||||
/* Get only sessions which has been active in the last 3600 sec. */
|
||||
$sessions = $sessionmgr->getLastAccessedSessions(date('Y-m-d H:i:s', time()-3600));
|
||||
|
||||
if ($user->isGuest() || count($sessions) == 0) {
|
||||
|
@ -58,7 +59,7 @@ class SeedDMS_View_Session extends SeedDMS_Bootstrap_Style {
|
|||
foreach($sessions as $session) {
|
||||
if($sesuser = $dms->getUser($session->getUser()))
|
||||
if(!$sesuser->isHidden())
|
||||
$content .= " <li><a _href=\"\"><i class=\"icon-user\"></i> ".htmlspecialchars($sesuser->getFullName())." ".getReadableDuration(time()-$session->getLastAccess())."</a></li>\n";
|
||||
$content .= " <li><a _href=\"\"><i class=\"icon-user\"></i> ".htmlspecialchars($sesuser->getFullName()).($user->isAdmin() ? " ".getReadableDuration(time()-$session->getLastAccess()) : "")."</a></li>\n";
|
||||
}
|
||||
$content .= " </ul>\n";
|
||||
$content .= " </li>\n";
|
||||
|
|
Loading…
Reference in New Issue
Block a user