Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

+29 -8
View File
@@ -26,7 +26,7 @@ class _Database extends \IPS\Session\Store
* Load the session from the storage engine
*
* @param string $sessionId Session ID
* @return array
* @return array|NULL
*/
public function loadSession( $sessionId )
{
@@ -197,13 +197,34 @@ class _Database extends \IPS\Session\Store
$memberSubWhere[] = 's.member_id IS NOT NULL';
/* Ok, this looks odd, but the ONLY_FULL_GROUP_BY bites us here, so selecting max(id) allows us to return a session ID even though we're grouping on member_id */
$where = array(
array(
"( core_sessions.id IN(?) OR core_sessions.id IN(?) )",
\IPS\Db::i()->select( 'MAX(id)', array( 'core_sessions', 's' ), $memberSubWhere, NULL, NULL, 'member_id' ),
\IPS\Db::i()->select( 'MAX(id)', array( 'core_sessions', 's' ), $guestSubWhere, NULL, NULL, 'ip_address' )
)
);
if ( $flags AND ! ( $flags & static::ONLINE_GUESTS ) )
{
$where = array(
array(
"core_sessions.id IN(?)",
\IPS\Db::i()->select( 'MAX(id)', array( 'core_sessions', 's' ), $memberSubWhere, NULL, NULL, 'member_id' ),
)
);
}
elseif ( $flags AND ! ( $flags & static::ONLINE_MEMBERS ) )
{
$where = array(
array(
"core_sessions.id IN(?)",
\IPS\Db::i()->select( 'MAX(id)', array( 'core_sessions', 's' ), $guestSubWhere, NULL, NULL, 'ip_address' )
)
);
}
else
{
$where = array(
array(
"( core_sessions.id IN(?) OR core_sessions.id IN(?) )",
\IPS\Db::i()->select( 'MAX(id)', array( 'core_sessions', 's' ), $memberSubWhere, NULL, NULL, 'member_id' ),
\IPS\Db::i()->select( 'MAX(id)', array( 'core_sessions', 's' ), $guestSubWhere, NULL, NULL, 'ip_address' )
)
);
}
/* Limiting to a user group? */
if ( $memberGroup )