From 2a392ef61c1ac5fe04860e150fa4aba855b3d0ac Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 2 Oct 2008 02:45:58 +0000 Subject: [PATCH] Don't claim that there's an invalid password if no password is set - members may be created for newsletters, etc. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63506 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- security/Member.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/Member.php b/security/Member.php index 8bb1398e3..b9a474a07 100644 --- a/security/Member.php +++ b/security/Member.php @@ -978,13 +978,13 @@ class Member extends DataObject { $valid = parent::validate(); if(!$this->ID || (isset($this->changed['Password']) && $this->changed['Password'])) { - if(self::$password_validator) { + if($this->Password && self::$password_validator) { $valid->combineAnd(self::$password_validator->validate($this->Password, $this)); } } if((!$this->ID && $this->SetPassword) || (isset($this->changed['SetPassword']) && $this->changed['SetPassword'])) { - if(self::$password_validator) { + if($this->SetPassword && self::$password_validator) { $valid->combineAnd(self::$password_validator->validate($this->SetPassword, $this)); } }