From 1c0ae76f8ef400f5418f53f79822e6bf9a82703c Mon Sep 17 00:00:00 2001 From: Will Morgan Date: Thu, 30 May 2013 14:16:12 +0100 Subject: [PATCH] Adding passwordless message instead of throwing an exception --- security/Member.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/security/Member.php b/security/Member.php index 232aa0dd4..3afbd5361 100644 --- a/security/Member.php +++ b/security/Member.php @@ -210,6 +210,11 @@ class Member extends DataObject implements TemplateGlobalProvider { public function checkPassword($password) { $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); if(!$e->check($this->Password, $password, $this->Salt, $this)) { $result->error(_t (