Version 4.7.0

This commit is contained in:
Neo committed 2025-12-19 16:00:35 -08:00
1 parent 517a5e1f70
commit 8ba7d43898
1933 files changed
+65613 -11332

No files matched your search

+13 -2
View File
@@ -100,6 +100,17 @@ class _Front extends \IPS\Session
$session = NULL;
}
/* Validate member_id cookie against member_id the session belongs to */
if( $session and isset( \IPS\Request::i()->cookie['member_id'] ) AND \IPS\Request::i()->cookie['member_id'] != $session['member_id'] )
{
$session = FALSE;
}
/* If the session is for a member but the member_id cookie is not present, wipe the session */
elseif( $session AND $session['member_id'] > 0 AND empty( \IPS\Request::i()->cookie['member_id'] ) )
{
$session = FALSE;
}
/* We match bots by browser and IP address, so reset our session ID if we found a matching bot row */
if( $session AND $session['uagent_type'] == 'search' AND $session['id'] != $this->sessionId )
{
@@ -237,11 +248,11 @@ class _Front extends \IPS\Session
\IPS\Request::i()->clearLoginCookies();
}
}
/* Work out the type */
if ( $this->member->member_id )
{
if ( $this->member->group['g_hide_online_list'] != 2 AND ( ( $session and $session['login_type'] === static::LOGIN_TYPE_ANONYMOUS ) or ( $device and $device->anonymous ) OR $this->member->group['g_hide_online_list'] == 1 ) )
if ( $this->member->group['g_hide_online_list'] != 2 AND ( ( $session and $session['login_type'] === static::LOGIN_TYPE_ANONYMOUS ) or ( $this->member->members_bitoptions['is_anon'] ) OR $this->member->group['g_hide_online_list'] == 1 ) )
{
$type = static::LOGIN_TYPE_ANONYMOUS;
}
+4 -4
View File
@@ -65,7 +65,7 @@ abstract class _Session
{
$location = \substr( $classname, 12 );
}
if ( class_exists( $classname ) )
{
/* Create class */
@@ -193,12 +193,12 @@ abstract class _Session
$this->member->last_activity = time();
}
}
/* Set timezone */
if ( isset( \IPS\Request::i()->cookie['ipsTimezone'] ) and \IPS\Request::i()->cookie['ipsTimezone'] !== $this->member->timezone and \in_array( \IPS\Request::i()->cookie['ipsTimezone'], \DateTimeZone::listIdentifiers() ) )
if ( isset( \IPS\Request::i()->cookie['ipsTimezone'] ) and \IPS\Request::i()->cookie['ipsTimezone'] !== $this->member->timezone and \in_array( \IPS\DateTime::getFixedTimezone( \IPS\Request::i()->cookie['ipsTimezone'] ), \DateTimeZone::listIdentifiers() ) )
{
$save = TRUE;
$this->member->timezone = \IPS\Request::i()->cookie['ipsTimezone'];
$this->member->timezone = \IPS\DateTime::getFixedTimezone( \IPS\Request::i()->cookie['ipsTimezone'] );
}
/* Save */
+11 -8
View File
@@ -197,19 +197,22 @@ class _Redis extends \IPS\Session\Store
{
$redis = \IPS\Redis::i()->zRevRangeByScore( static::_key( 'session_online_users' ), '+inf', '-inf', array('withscores' => FALSE, 'alpha' => TRUE ) );
foreach( $redis as $data )
if( \is_array( $redis ) )
{
list( $id, $sessionKey ) = explode( '__', $data );
if ( $id == $memberId )
foreach ( $redis as $data )
{
if ( $result = \IPS\Redis::i()->hGetAll( static::_key( $sessionKey ) ) )
list( $id, $sessionKey ) = explode( '__', $data );
if ( $id == $memberId )
{
try
if ( $result = \IPS\Redis::i()->hGetAll( static::_key( $sessionKey ) ) )
{
return \IPS\Redis::i()->decode( $result['data'] );
try
{
return \IPS\Redis::i()->decode( $result['data'] );
}
catch ( \RedisException $e ) {}
}
catch( \RedisException $e ){}
}
}
}