Fixed linting errors

This commit is contained in:
Ingo Schommer 2017-06-23 11:19:16 +12:00
parent 12c2edc1d5
commit fa568e333e
4 changed files with 16 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -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)) {

View File

@ -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