Version 4.3.6

This commit is contained in:
Neo committed 2025-12-19 05:49:12 -08:00
1 parent fe1acf984a
commit 1a0c7fd3c2
609 files changed
+14707 -5726

No files matched your search

+5 -45
View File
@@ -74,7 +74,7 @@ class _Database extends \IPS\Session\Store
*/
public function updateSession( $data )
{
\IPS\Db::i()->replace( 'core_sessions', $data, TRUE );
\IPS\Db::i()->insert( 'core_sessions', $data, TRUE );
}
/**
@@ -155,15 +155,14 @@ class _Database extends \IPS\Session\Store
/**
* Fetch all online users (but not spiders)
*
* @param int $flags Bitwise flags
* @param array $skipGroups Ignore members in these groups
* @param int $flags Bitwise flags
* @param string $sort Sort direction
* @param array|NULL $limit Limit [ offset, limit ]
* @param int $memberGroup Limit by a specific member group ID
* @param boolean $showAnonymous Show anonymously logged in peoples?
* @param boolean $includeAllGroups Include all groups? Used for statistics primarily.
* @return array
*/
public function getOnlineUsers( $flags=0, $sort='desc', $limit=NULL, $memberGroup=NULL, $showAnonymous=FALSE, $includeAllGroups=FALSE )
public function getOnlineUsers( $flags=0, $sort='desc', $limit=NULL, $memberGroup=NULL, $showAnonymous=FALSE )
{
/* Query */
$where = array(
@@ -175,23 +174,6 @@ class _Database extends \IPS\Session\Store
{
$where[] = array( "s.login_type!=?", \IPS\Session\Front::LOGIN_TYPE_ANONYMOUS );
}
if( ! $includeAllGroups )
{
$notInMyName = array();
foreach( \IPS\Member\Group::groups() as $group )
{
if ( $group->g_hide_online_list )
{
$notInMyName[] = $group->g_id;
}
}
if ( count( $notInMyName ) )
{
$where[] = array( \IPS\Db::i()->in( 's.member_group', $notInMyName, TRUE ) );
}
}
if ( ! $flags and ! $limit )
{
@@ -205,14 +187,6 @@ class _Database extends \IPS\Session\Store
/* 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.member_id IS NULL AND core_sessions.login_type != ? AND core_sessions.running_time > ?) )", \IPS\Db::i()->select( 'MAX(id)', array( 'core_sessions', 's' ), $subWhere, NULL, NULL, 'member_id' ), \IPS\Session\Front::LOGIN_TYPE_SPIDER, \IPS\DateTime::create()->sub( new \DateInterval( 'PT30M' ) )->getTimeStamp() ) );
if( ! $includeAllGroups )
{
if ( count( $notInMyName ) )
{
$where[] = array( \IPS\Db::i()->in( 'core_sessions.member_group', $notInMyName, TRUE ) );
}
}
/* Limiting to a user group? */
if ( $memberGroup )
@@ -269,21 +243,7 @@ class _Database extends \IPS\Session\Store
{
$where[] = array( 'core_sessions.current_id = ?', \IPS\Request::i()->id );
}
$notInMyName = array();
foreach( \IPS\Member\Group::groups() as $group )
{
if ( $group->g_hide_online_list )
{
$notInMyName[] = $group->g_id;
}
}
if ( count( $notInMyName ) )
{
$where[] = array( \IPS\Db::i()->in( 'core_sessions.member_group', $notInMyName, TRUE ) );
}
foreach( \IPS\Db::i()->select( 'core_sessions.member_id,core_sessions.member_name,core_sessions.seo_name,core_sessions.member_group,core_sessions.login_type,core_sessions.in_editor', 'core_sessions', $where, 'core_sessions.running_time DESC' ) as $row )
{
if( $row['login_type'] == \IPS\Session\Front::LOGIN_TYPE_MEMBER and $row['member_name'] )