mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
number of user session can be limited
This commit is contained in:
parent
183bdcfa69
commit
00fe04a82f
|
@ -473,8 +473,11 @@ class SeedDMS_SessionMgr {
|
||||||
*
|
*
|
||||||
* @return array list of sessions
|
* @return array list of sessions
|
||||||
*/
|
*/
|
||||||
function getUserSessions($user) { /* {{{ */
|
function getUserSessions($user, $limit=0) { /* {{{ */
|
||||||
$queryStr = "SELECT * FROM `tblSessions` WHERE `userID`=".$user->getID();
|
$queryStr = "SELECT * FROM `tblSessions` WHERE `userID`=".$user->getID();
|
||||||
|
$queryStr .= " ORDER BY `lastAccess` DESC";
|
||||||
|
if($limit > 0)
|
||||||
|
$queryStr .= " LIMIT ".(int) $limit;
|
||||||
$resArr = $this->db->getResultArray($queryStr);
|
$resArr = $this->db->getResultArray($queryStr);
|
||||||
if (is_bool($resArr) && $resArr == false)
|
if (is_bool($resArr) && $resArr == false)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user