From b93a8257f4ed80e78551eda84e1eb1c4bcfa13ca Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 3 Nov 2008 03:41:14 +0000 Subject: [PATCH] BUGFIX Fixed call to Member function that didn't exist MINOR Check if OldPassword data exists before running checkPassword() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65135 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- security/ChangePasswordForm.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/ChangePasswordForm.php b/security/ChangePasswordForm.php index 7d53ab0f6..67787cfb9 100755 --- a/security/ChangePasswordForm.php +++ b/security/ChangePasswordForm.php @@ -22,7 +22,7 @@ class ChangePasswordForm extends Form { function __construct($controller, $name, $fields = null, $actions = null) { if(!$fields) { $fields = new FieldSet(); - if(Member::currentUser() && (!isset($_REQUEST['h']) || !Member::member_from_autologin($_REQUEST['h']))) { + if(Member::currentUser() && (!isset($_REQUEST['h']) || !Member::member_from_autologinhash($_REQUEST['h']))) { $fields->push(new PasswordField("OldPassword",_t('Member.YOUROLDPASSWORD', "Your old password"))); } @@ -47,7 +47,7 @@ class ChangePasswordForm extends Form { function doChangePassword(array $data) { if($member = Member::currentUser()) { // The user was logged in, check the current password - if($member->checkPassword($data['OldPassword']) == false) { + if(isset($data['OldPassword']) && $member->checkPassword($data['OldPassword']) == false) { $this->clearMessage(); $this->sessionMessage( _t('Member.ERRORPASSWORDNOTMATCH', "Your current password does not match, please try again"),