From f141fbe5add17045d07338bc6ca5eb986a73e22a Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Tue, 4 Dec 2007 03:53:46 +0000 Subject: [PATCH] To include OldPassword field only when the curruentUser exists and (no autologinhash given or the autologinhash is not right), since there a lots of cases that the currentUser exists (like a temperary member ) but he hasn't got password yet. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@46304 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- security/ChangePasswordForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/ChangePasswordForm.php b/security/ChangePasswordForm.php index 4637e6adf..f6f043f68 100755 --- a/security/ChangePasswordForm.php +++ b/security/ChangePasswordForm.php @@ -26,7 +26,7 @@ class ChangePasswordForm extends Form { function __construct($controller, $name, $fields = null, $actions = null) { if(!$fields) { $fields = new FieldSet(); - if(Member::currentUser()) { + if(Member::currentUser()&&(!isset($_REQUEST['h']) ||!Member::autoLoginHash($_REQUEST['h']))) { $fields->push(new EncryptField("OldPassword",_t('Member.YOUROLDPASSWORD', "Your old password"))); }