mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Fixed linting errors
This commit is contained in:
parent
12c2edc1d5
commit
fa568e333e
@ -94,14 +94,14 @@ class CMSSecurity extends Security
|
|||||||
$message = parent::getSessionMessage($messageType);
|
$message = parent::getSessionMessage($messageType);
|
||||||
if ($message) {
|
if ($message) {
|
||||||
return $message;
|
return $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format
|
// Format
|
||||||
return _t(
|
return _t(
|
||||||
__CLASS__.'.LOGIN_MESSAGE',
|
__CLASS__.'.LOGIN_MESSAGE',
|
||||||
'<p>Your session has timed out due to inactivity</p>'
|
'<p>Your session has timed out due to inactivity</p>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if there is a logged in member
|
* Check if there is a logged in member
|
||||||
|
@ -268,7 +268,7 @@ class Member extends DataObject
|
|||||||
{
|
{
|
||||||
Deprecation::notice('5.0', 'Use DefaultAdminService::findOrCreateDefaultAdmin() instead');
|
Deprecation::notice('5.0', 'Use DefaultAdminService::findOrCreateDefaultAdmin() instead');
|
||||||
return DefaultAdminService::singleton()->findOrCreateDefaultAdmin();
|
return DefaultAdminService::singleton()->findOrCreateDefaultAdmin();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the passed password matches the stored one (if the member is not locked out).
|
* Check if the passed password matches the stored one (if the member is not locked out).
|
||||||
@ -287,12 +287,12 @@ class Member extends DataObject
|
|||||||
$authenticators = Security::singleton()->getApplicableAuthenticators(Authenticator::CHECK_PASSWORD);
|
$authenticators = Security::singleton()->getApplicableAuthenticators(Authenticator::CHECK_PASSWORD);
|
||||||
foreach ($authenticators as $authenticator) {
|
foreach ($authenticators as $authenticator) {
|
||||||
$authenticator->checkPassword($this, $password, $result);
|
$authenticator->checkPassword($this, $password, $result);
|
||||||
if (!$result->isValid()) {
|
if (!$result->isValid()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if this user is the currently configured default admin
|
* Check if this user is the currently configured default admin
|
||||||
|
@ -100,12 +100,12 @@ class MemberAuthenticator implements Authenticator
|
|||||||
}
|
}
|
||||||
} elseif ($member) {
|
} elseif ($member) {
|
||||||
$member->registerSuccessfulLogin();
|
$member->registerSuccessfulLogin();
|
||||||
} else {
|
} else {
|
||||||
// A non-existing member occurred. This will make the result "valid" so let's invalidate
|
// A non-existing member occurred. This will make the result "valid" so let's invalidate
|
||||||
$result->addError(_t(
|
$result->addError(_t(
|
||||||
'SilverStripe\\Security\\Member.ERRORWRONGCRED',
|
'SilverStripe\\Security\\Member.ERRORWRONGCRED',
|
||||||
"The provided details don't seem to be correct. Please try again."
|
"The provided details don't seem to be correct. Please try again."
|
||||||
));
|
));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ class MemberAuthenticator implements Authenticator
|
|||||||
// Check a password is set on this member
|
// Check a password is set on this member
|
||||||
if (empty($member->Password) && $member->exists()) {
|
if (empty($member->Password) && $member->exists()) {
|
||||||
$result->addError(_t(__CLASS__ . '.NoPassword', 'There is no password on this member.'));
|
$result->addError(_t(__CLASS__ . '.NoPassword', 'There is no password on this member.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$encryptor = PasswordEncryptor::create_for_algorithm($member->PasswordEncryption);
|
$encryptor = PasswordEncryptor::create_for_algorithm($member->PasswordEncryption);
|
||||||
if (!$encryptor->check($member->Password, $password, $member->Salt, $member)) {
|
if (!$encryptor->check($member->Password, $password, $member->Salt, $member)) {
|
||||||
|
@ -1012,7 +1012,7 @@ class Security extends Controller implements TemplateGlobalProvider
|
|||||||
|
|
||||||
$service = DefaultAdminService::singleton();
|
$service = DefaultAdminService::singleton();
|
||||||
return $service->findOrCreateDefaultAdmin();
|
return $service->findOrCreateDefaultAdmin();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flush the default admin credentials
|
* Flush the default admin credentials
|
||||||
|
Loading…
x
Reference in New Issue
Block a user