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
This commit is contained in:
Normann Lou 2007-12-04 03:53:46 +00:00
parent de30b37795
commit f141fbe5ad

View File

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