diff options
author | M.Gergo | 2018-07-06 11:14:41 +0200 |
---|---|---|
committer | M.Gergo | 2018-07-06 11:14:41 +0200 |
commit | 43de9af71f7f4ca5731b94a06d688ae8412ba427 (patch) | |
tree | 54835de1dfcda504c02da261f0dc26885aed2e89 /mayor-orig/www/include/modules/session/sessionAdmin.php | |
parent | 50310b0e4513ee3fcce67351ae61e8fff851130e (diff) | |
download | mayor-43de9af71f7f4ca5731b94a06d688ae8412ba427.tar.gz mayor-43de9af71f7f4ca5731b94a06d688ae8412ba427.zip |
2018/Feb/28 -i állapot hozzáadva, mint a módosítások kiindulási állapota
Diffstat (limited to 'mayor-orig/www/include/modules/session/sessionAdmin.php')
-rw-r--r-- | mayor-orig/www/include/modules/session/sessionAdmin.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mayor-orig/www/include/modules/session/sessionAdmin.php b/mayor-orig/www/include/modules/session/sessionAdmin.php new file mode 100644 index 00000000..ff3e99b8 --- /dev/null +++ b/mayor-orig/www/include/modules/session/sessionAdmin.php @@ -0,0 +1,24 @@ +<?php + + function getSessions() { + + $W = array(); + if (intval(_SESSION_MAX_TIME) != 0) $W[] = "dt + INTERVAL ".intval(_SESSION_MAX_TIME)." HOUR > NOW()"; + if (intval(_SESSION_MAX_IDLE_TIME) != 0) $W[] = "activity + INTERVAL ".intval(_SESSION_MAX_IDLE_TIME)." HOUR > NOW()"; + $q = "SELECT userAccount,dt,policy,sessionID,userCn,studyId,skin,lang,activity,sessionCookie,ip FROM session LEFT JOIN loginLog USING (policy,userAccount,dt)"; + if (count($W) > 0) $q .= " WHERE ".implode(' AND ', $W); + $q .= " ORDER BY activity DESC"; + + $ret = db_query($q, array('fv' => 'getSessions', 'modul' => 'login', 'result' => 'indexed')); + return $ret; + } + + function deleteSession($sessionID, $policy) { + + $q = "DELETE FROM session WHERE sessionID='%s' AND policy='%s'"; + $v = array($sessionID, $policy); + return db_query($q, array('fv' => 'deleteSession','modul' => 'login', 'values' => $v)); + + } + +?> |