Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -22,12 +22,16 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _Exception extends \DomainException
|
||||
{
|
||||
const INTERNAL_ERROR = 1;
|
||||
const REGISTRATION_DENIED_BY_SPAM_SERVICE = 2;
|
||||
const REGISTRATION_DISABLED = 3;
|
||||
const BAD_PASSWORD = 4;
|
||||
const NO_ACCOUNT = 5;
|
||||
// If two login handlers produce different exceptions, the one with the higher code is shown
|
||||
// For example: if internal database returns "NO_ACCOUNT", but external returns "BAD_PASSWORD", the
|
||||
// message the user needs to see is of course "Password incorrect" (rather than "Account does not exist")
|
||||
const NO_ACCOUNT = 1;
|
||||
const INTERNAL_ERROR = 2;
|
||||
const REGISTRATION_DENIED_BY_SPAM_SERVICE = 3;
|
||||
const REGISTRATION_DISABLED = 4;
|
||||
const BAD_PASSWORD = 5;
|
||||
const MERGE_SOCIAL_ACCOUNT = 6;
|
||||
const ACCOUNT_LOCKED = 7;
|
||||
|
||||
/**
|
||||
* @brief Member
|
||||
@@ -55,15 +59,6 @@ class _Exception extends \DomainException
|
||||
*/
|
||||
public function __construct( $message, $code=NULL, $previous=NULL, $member=NULL )
|
||||
{
|
||||
if ( $code === static::BAD_PASSWORD and $member !== NULL )
|
||||
{
|
||||
/* $member->failed_logins may not be an array explicitly when upgrading due to past bugs */
|
||||
$failedLogins = is_array( $member->failed_logins ) ? $member->failed_logins : array();
|
||||
$failedLogins[ \IPS\Request::i()->ipAddress() ][] = time();
|
||||
$member->failed_logins = $failedLogins;
|
||||
$member->save();
|
||||
}
|
||||
|
||||
parent::__construct( $message, $code, $previous );
|
||||
$this->member = $member;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user