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
This commit is contained in:
Sam Minnee 2008-10-02 02:45:58 +00:00
parent cba8e71170
commit 2a392ef61c

View File

@ -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));
}
}