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.

Customising the CMS /

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

Forgot Password

Go to End

2 Posts   772 Views


Community Member, 15 Posts

14 August 2014 at 1:31am

We are working on a page with Silverstripe and changed the login. Users can now login with a username instead of the email address. To make this possible, we added "Member::set_unique_identifier_field('Username');" to the _config.php.

Now we want to change the way a user can reset their password if they forget it. We want to make it possible to use the username instead of the email-address to get an email with the link to reset their password.
To this end, we have tried several things in the /mysite/_config.php, but it doesn't seem to work.

1. Object::add_extension('Security', 'UsernameSecurity');
2. Object::useCustomClass('Security','UsernameSecurity');
3. Director::addRules(11, array(
'Security//$Action/$ID/$OtherID' => 'UsernameSecurity',
Does anyone have any suggestions to get this to work better? Thank you in advance for your help!


Community Member, 59 Posts

14 August 2014 at 11:26am

I think the useCustomClass approach would be the best and just override the methods lostpassword and LostPaswordForm to reset the password$useCustomClass