Version 4.7.23
This commit is contained in:
1 parent
7124a02564
commit
25ddeb65d6
1791 files changed
+76990
-44452
No files matched your search
@@ -188,10 +188,7 @@ class _Front extends \IPS\Session
|
||||
/* Or if the access token wasn't valid, log it as a fail so that it can't be bruteforced */
|
||||
else
|
||||
{
|
||||
$failedLogins = \is_array( $expectedMember->failed_logins ) ? $expectedMember->failed_logins : array();
|
||||
$failedLogins[ \IPS\Request::i()->ipAddress() ][] = time();
|
||||
$expectedMember->failed_logins = $failedLogins;
|
||||
$expectedMember->save();
|
||||
$expectedMember->failedLogin();
|
||||
}
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
@@ -231,10 +228,7 @@ class _Front extends \IPS\Session
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
/* ... so log it as a failed login */
|
||||
$failedLogins = \is_array( $member->failed_logins ) ? $member->failed_logins : array();
|
||||
$failedLogins[ \IPS\Request::i()->ipAddress() ][] = time();
|
||||
$member->failed_logins = $failedLogins;
|
||||
$member->save();
|
||||
$member->failedLogin();
|
||||
|
||||
/* Then set us as a guest and clear out those cookies */
|
||||
$this->member = new \IPS\Member;
|
||||
@@ -267,7 +261,7 @@ class _Front extends \IPS\Session
|
||||
}
|
||||
else
|
||||
{
|
||||
$type = $this->userAgent->spider ? static::LOGIN_TYPE_SPIDER : static::LOGIN_TYPE_GUEST;
|
||||
$type = $this->userAgent->bot ? static::LOGIN_TYPE_SPIDER : static::LOGIN_TYPE_GUEST;
|
||||
}
|
||||
|
||||
/* Set data */
|
||||
@@ -289,7 +283,7 @@ class _Front extends \IPS\Session
|
||||
'current_id' => ( \IPS\Request::i()->isAjax() ) ? ( $session ? $session['current_id'] : NULL ) : \intval( \IPS\Request::i()->id ),
|
||||
'uagent_key' => $this->userAgent->browser ?: '',
|
||||
'uagent_version' => $this->userAgent->browserVersion ?: '',
|
||||
'uagent_type' => $this->userAgent->spider ? 'search' : 'browser',
|
||||
'uagent_type' => $this->userAgent->bot ? 'search' : 'browser',
|
||||
'search_thread_id' => $session ? \intval( $session['search_thread_id'] ) : 0,
|
||||
'search_thread_time' => $session ? $session['search_thread_time'] : 0,
|
||||
'data' => $session ? $session['data'] : '',
|
||||
@@ -303,10 +297,10 @@ class _Front extends \IPS\Session
|
||||
);
|
||||
|
||||
/* Is this a spider? */
|
||||
if( $this->userAgent->spider )
|
||||
if( $this->userAgent->bot )
|
||||
{
|
||||
/* Is this Facebook? Do we need to treat them as a user of a different group? */
|
||||
if( $this->userAgent->spider == 'facebook' )
|
||||
if( $this->userAgent->bot == 'facebook' )
|
||||
{
|
||||
if( \IPS\core\ShareLinks\Service::load( 'facebook', 'share_key' )->enabled )
|
||||
{
|
||||
@@ -376,7 +370,7 @@ class _Front extends \IPS\Session
|
||||
$this->data['data'] = $data;
|
||||
$this->setLocationData();
|
||||
|
||||
if ( $this->save === TRUE and ( !empty( \IPS\Request::i()->cookie ) or $this->userAgent->spider or $this->member->member_id ) ) // If a guest and cookies are disabled we do not write to database to prevent duplicate sessions unless it's a search engine, which we deal with separately
|
||||
if ( $this->save === TRUE and ( !empty( \IPS\Request::i()->cookie ) or $this->userAgent->bot or $this->member->member_id ) ) // If a guest and cookies are disabled we do not write to database to prevent duplicate sessions unless it's a search engine, which we deal with separately
|
||||
{
|
||||
\IPS\Session\Store::i()->updateSession( $this->data );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user