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);
if ($message) {
return $message;
}
}
// Format
return _t(
return _t(
__CLASS__.'.LOGIN_MESSAGE',
'<p>Your session has timed out due to inactivity</p>'
);
}
);
}
/**
* 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');
return DefaultAdminService::singleton()->findOrCreateDefaultAdmin();
}
}
/**
* 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);
foreach ($authenticators as $authenticator) {
$authenticator->checkPassword($this, $password, $result);
if (!$result->isValid()) {
if (!$result->isValid()) {
break;
}
}
}
return $result;
}
}
/**
* Check if this user is the currently configured default admin

View File

@ -100,12 +100,12 @@ class MemberAuthenticator implements Authenticator
}
} elseif ($member) {
$member->registerSuccessfulLogin();
} else {
// A non-existing member occurred. This will make the result "valid" so let's invalidate
$result->addError(_t(
'SilverStripe\\Security\\Member.ERRORWRONGCRED',
"The provided details don't seem to be correct. Please try again."
));
} else {
// A non-existing member occurred. This will make the result "valid" so let's invalidate
$result->addError(_t(
'SilverStripe\\Security\\Member.ERRORWRONGCRED',
"The provided details don't seem to be correct. Please try again."
));
return null;
}
@ -139,7 +139,7 @@ class MemberAuthenticator implements Authenticator
// Check a password is set on this member
if (empty($member->Password) && $member->exists()) {
$result->addError(_t(__CLASS__ . '.NoPassword', 'There is no password on this member.'));
}
}
$encryptor = PasswordEncryptor::create_for_algorithm($member->PasswordEncryption);
if (!$encryptor->check($member->Password, $password, $member->Salt, $member)) {

View File

@ -1012,7 +1012,7 @@ class Security extends Controller implements TemplateGlobalProvider
$service = DefaultAdminService::singleton();
return $service->findOrCreateDefaultAdmin();
}
}
/**
* Flush the default admin credentials