Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

login form change lostpass url


Go to End


3 Posts   1204 Views

Avatar
WaaaghNL

Community Member, 4 Posts

14 February 2012 at 5:52am

Hello,

is there someone who knows where i can change the url for a lostpassword? i found on line 80 from /sapphire/security/MemberLoginForm.php a URL but when i change it nothing happens (i flusht and run a /dev/build)

Ronald

Avatar
Willr

Forum Moderator, 5523 Posts

14 February 2012 at 4:07pm

The url is fixed as it is the name of the method (function lost password()) you could implement your own lost password form then you have control over the url or have redirection setup so site.com/resetpassword redirects to site.com/Security/lostpassword

Avatar
WaaaghNL

Community Member, 4 Posts

15 February 2012 at 4:14pm

Thanks i have changed
/sapphire/security/Security.php (rule 449 to 467)

public function LostPasswordForm() {
return new MemberLoginForm(
$this,
'LostPasswordForm',
new FieldSet(
new EmailField('Email', _t('Member.EMAIL', 'Email'))
),
new FieldSet(
new FormAction(
'forgotPassword',
_t('Security.BUTTONSEND', 'Send me the password reset link')
)
),
false
);
}

TO
public function LostPasswordForm() {
Director::redirect('wachtwoord-vergeten');
/*
return new MemberLoginForm(
$this,
'LostPasswordForm',
new FieldSet(
new EmailField('Email', _t('Member.EMAIL', 'Email'))
),
new FieldSet(
new FormAction(
'forgotPassword',
_t('Security.BUTTONSEND', 'Send me the password reset link')
)
),
false
);
*/
}