Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -67,10 +67,7 @@ class _Redis extends \IPS\Session\Store
|
||||
), static::$ttl );
|
||||
|
||||
/* Update the list of sessions for the online list [ microtime => sessionID ] */
|
||||
if ( ! $group->g_hide_online_list )
|
||||
{
|
||||
\IPS\Redis::i()->zAdd( $this->_key( 'session_map' ), time(), 'session_id_' . md5( $data['id'] . \IPS\Settings::i()->sql_pass ), static::$ttl );
|
||||
}
|
||||
\IPS\Redis::i()->zAdd( $this->_key( 'session_map' ), time(), 'session_id_' . md5( $data['id'] . \IPS\Settings::i()->sql_pass ), static::$ttl );
|
||||
|
||||
/* Update users list */
|
||||
if ( $data['uagent_type'] == 'search' )
|
||||
@@ -78,7 +75,7 @@ class _Redis extends \IPS\Session\Store
|
||||
/* Make a unique row based on IP and user-agent to prevent multiple rows for each spider */
|
||||
\IPS\Redis::i()->zAdd( $this->_key( 'session_online_spiders' ), time(), md5( $data['ip_address'] . $data['browser'] ), static::$ttl );
|
||||
}
|
||||
else if ( $data['member_id'] and ! $group->g_hide_online_list )
|
||||
else if ( $data['member_id'] )
|
||||
{
|
||||
\IPS\Redis::i()->zAdd( $this->_key( 'session_online_users' ), time(), $data['member_id'] . '__' . 'session_id_' . md5( $data['id'] . \IPS\Settings::i()->sql_pass ), static::$ttl );
|
||||
}
|
||||
@@ -237,15 +234,14 @@ class _Redis 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 )
|
||||
{
|
||||
$results = \IPS\Redis::i()->lRange('session_onlinelist', 0, -1 );
|
||||
|
||||
@@ -256,7 +252,7 @@ class _Redis extends \IPS\Session\Store
|
||||
'store' => \IPS\Redis::i()->prefix . 'session_onlinelist',
|
||||
'alpha' => true,
|
||||
'by' => 'nosort ' . $sort === 'asc' ? 'asc' : 'desc',
|
||||
'ttl' => 60,
|
||||
'ttl' => 30, /* This ensures the stored file session_online only lasts for 30 seconds */
|
||||
'get' => array(
|
||||
$this->_key( \IPS\Redis::i()->prefix ) . '*->member_id',
|
||||
$this->_key( \IPS\Redis::i()->prefix ) . '*->member_name',
|
||||
@@ -300,6 +296,12 @@ class _Redis extends \IPS\Session\Store
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Cut off is 30 mins */
|
||||
if ( $data['running_time'] < ( time() - ( 30 * 60 ) ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$return[ $fields['member_id'] ? $fields['member_id'] : $data['ip_address'] ] = array_merge( $data, $fields );
|
||||
}
|
||||
}
|
||||
@@ -372,7 +374,7 @@ class _Redis extends \IPS\Session\Store
|
||||
|
||||
foreach( $this->getOnlineUsers( 0, 'desc' ) as $member )
|
||||
{
|
||||
if ( ! \IPS\Member\Group::load( $member['member_group'] )->g_hide_online_list and $member['current_appcomponent'] == $app and $member['current_module'] == $module and $member['current_controller'] = $controller and $member['current_id'] = $id )
|
||||
if ( $member['current_appcomponent'] == $app and $member['current_module'] == $module and $member['current_controller'] = $controller and $member['current_id'] = $id )
|
||||
{
|
||||
if ( $url and mb_stristr( $member['location_url'], $url ) )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user