summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/perm.inc.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-02-04 14:07:34 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-02-04 14:07:34 +0000
commitc7baec87cd3825785d33f66bad65493b4ff18e7d (patch)
tree0f82b78f8e799c9683fe26294c6ab2be5d2f1cb1 /frontends/php/include/perm.inc.php
parent5b09df95f41c91dbbcfe8112c10ef6f5a297103b (diff)
downloadzabbix-c7baec87cd3825785d33f66bad65493b4ff18e7d.tar.gz
zabbix-c7baec87cd3825785d33f66bad65493b4ff18e7d.tar.xz
zabbix-c7baec87cd3825785d33f66bad65493b4ff18e7d.zip
- minor improvements in Audit (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5318 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/perm.inc.php')
-rw-r--r--frontends/php/include/perm.inc.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/frontends/php/include/perm.inc.php b/frontends/php/include/perm.inc.php
index 300f1f03..83a3e767 100644
--- a/frontends/php/include/perm.inc.php
+++ b/frontends/php/include/perm.inc.php
@@ -43,6 +43,7 @@
global $ZBX_LOCALNODEID;
$USER_DETAILS = NULL;
+ $login = FALSE;
$sessionid = get_cookie("zbx_sessionid");
@@ -71,17 +72,17 @@
$login = (check_perm2login($USER_DETAILS['userid']) && check_perm2system($USER_DETAILS['userid']));
}
- if(!$login){
+ if($login){
+ zbx_setcookie("zbx_sessionid",$sessionid);
+ DBexecute("update sessions set lastaccess=".time()." where sessionid=".zbx_dbstr($sessionid));
+ }
+ else{
$USER_DETAILS = NULL;
zbx_unsetcookie('zbx_sessionid');
DBexecute("delete from sessions where sessionid=".zbx_dbstr($sessionid));
unset($sessionid);
}
- else{
- zbx_setcookie("zbx_sessionid",$sessionid);
- DBexecute("update sessions set lastaccess=".time()." where sessionid=".zbx_dbstr($sessionid));
- }
if($USER_DETAILS){
$USER_DETAILS['node'] = DBfetch(DBselect('select * from nodes where nodeid='.id2nodeid($USER_DETAILS['userid'])));