summaryrefslogtreecommitdiffstats
path: root/frontends/php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-05-28 07:56:21 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-05-28 07:56:21 +0000
commit8a5cdf2c7989e792e5ff8504de0ca4a3b15a8ddc (patch)
treebfcbd5652d2a21b3345a59a69846dab1f319c10d /frontends/php
parent6caa2d07503dc9b1f8e1b5606d49f3433707f4e6 (diff)
minor fix
git-svn-id: svn://svn.zabbix.com/trunk@4183 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
-rw-r--r--frontends/php/include/config.inc.php4
-rw-r--r--frontends/php/users.php10
2 files changed, 9 insertions, 5 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 364f079f..a0a95118 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -1204,7 +1204,9 @@ $result =
$status["users_count"]=$row["cnt"];
$status["users_online"]=0;
- $result=DBselect("select distinct s.userid from sessions s, users u where u.userid=s.userid and (s.lastaccess+u.autologout)>".time());
+ $result=DBselect("select distinct s.userid from sessions s, users u where u.userid=s.userid and u.autologout>0 and (s.lastaccess+u.autologout)>".time());
+ while(DBfetch($result)) $status["users_online"]++;
+ $result=DBselect("select distinct s.userid from sessions s, users u where u.userid=s.userid and u.autologout=0");
while(DBfetch($result)) $status["users_online"]++;
return $status;
diff --git a/frontends/php/users.php b/frontends/php/users.php
index a354c124..c096000f 100644
--- a/frontends/php/users.php
+++ b/frontends/php/users.php
@@ -386,12 +386,14 @@ include_once "include/page_header.php";
" order by alias");
while($db_user=DBfetch($db_users))
{
- $db_sessions = DBselect("select count(*) as count, max(s.lastaccess) as lastaccess".
- " from sessions s, users u".
- " where s.userid=".$db_user["userid"]." and s.userid=u.userid and (s.lastaccess+u.autologout)>=".time());
+ $db_sessions = DBselect('select count(*) as count, max(s.lastaccess) as lastaccess'.
+ ' from sessions s, users u'.
+ ' where s.userid='.$db_user['userid'].' and s.userid=u.userid '.
+ ' and ((s.lastaccess+u.autologout)>='.time().
+ ' or u.autologout=0)');
$db_ses_cnt=DBfetch($db_sessions);
- if($db_ses_cnt["count"]>0 || $db_user["autologout"] == 0)
+ if($db_ses_cnt["count"]>0)
$online=new CCol(S_YES.' ('.date('r',$db_ses_cnt['lastaccess']).')',"enabled");
else
$online=new CCol(S_NO,"disabled");