mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Adding passwordless message instead of throwing an exception
This commit is contained in:
parent
92135acc14
commit
1c0ae76f8e
@ -210,6 +210,11 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
|||||||
public function checkPassword($password) {
|
public function checkPassword($password) {
|
||||||
$result = $this->canLogIn();
|
$result = $this->canLogIn();
|
||||||
|
|
||||||
|
if(empty($this->Password) && $this->exists()) {
|
||||||
|
$result->error(_t('Member.NoPassword','There is no password on this member.'));
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
$e = PasswordEncryptor::create_for_algorithm($this->PasswordEncryption);
|
$e = PasswordEncryptor::create_for_algorithm($this->PasswordEncryption);
|
||||||
if(!$e->check($this->Password, $password, $this->Salt, $this)) {
|
if(!$e->check($this->Password, $password, $this->Salt, $this)) {
|
||||||
$result->error(_t (
|
$result->error(_t (
|
||||||
|
Loading…
Reference in New Issue
Block a user