Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -52,8 +52,15 @@ class _Admin extends \IPS\Session
|
||||
|
||||
try
|
||||
{
|
||||
$where = array( array( 'session_id=?', $sessionId ) );
|
||||
|
||||
if( !\IPS\IN_DEV OR !\IPS\DEV_DISABLE_ACP_SESSION_TIMEOUT )
|
||||
{
|
||||
$where[] = array( 'session_running_time>=?', ( time() - \IPS\ACP_SESSION_TIMEOUT ) );
|
||||
}
|
||||
|
||||
/* Load session */
|
||||
$session = \IPS\Db::i()->select( '*', 'core_sys_cp_sessions', array( 'session_id=? AND session_running_time>=?', $sessionId, ( time() - \IPS\Session::sessionLifetime() ) ) )->first();
|
||||
$session = \IPS\Db::i()->select( '*', 'core_sys_cp_sessions', $where )->first();
|
||||
$this->logInTime = $session['session_log_in_time'];
|
||||
|
||||
/* Store this so plugins can access */
|
||||
@@ -133,11 +140,14 @@ class _Admin extends \IPS\Session
|
||||
/**
|
||||
* Garbage Collection
|
||||
*
|
||||
* @param int $lifetime Unix timestamp of the oldest session to keep
|
||||
* @param int $lifetime Number of seconds to consider sessions expired beyond
|
||||
* @return bool
|
||||
*/
|
||||
public function gc( $lifetime )
|
||||
{
|
||||
/* We ignore $lifetime because we explicitly control how long sessions are valid for via a constant */
|
||||
$lifetime = \IPS\ACP_SESSION_TIMEOUT;
|
||||
|
||||
\IPS\Db::i()->delete( 'core_sys_cp_sessions', array( 'session_running_time<?', ( time() - $lifetime ) ) );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user