23486 Posts in 18995 Topics by 2878 members
|Go to End|
24 August 2009 at 3:22pm
I have created a Custom Login page using Security_login.ss. How do I do the same for the 'I've lost my password' page. For example, when you click on the 'I've lost my password' link, it takes you to another page that uses the sites Page.ss when in fact I want it to use a custom page similar to the custom login page I have already created? I did try using the ForgotPasswordEmail.ss but that seems to be used just for customizing the content that is sent to the email address and not for creating a custom forgot password email page.
Any help would be greatly appreciated.
25 August 2009 at 5:38am Last edited: 26 August 2009 2:31am
EDIT: I seriously overcomplicated the matter here, see next post for the best answer.
The lost password section doesn't use a .ss template file. A 'virtual' page is created and rendered when you go to yoursite.com/Security/lostpassword. You have 2 options that I can think of:
1. Go in and change the page under /sapphire/security/Security.php starting at line 376
This is the easiest and will get it done for you but it is NEVER a good idea to modify a framework's code. Your site will break if you upgrade.
2. Extend the Security object and override the lostpassword() function to use your own code that renders with a template. You would then have to switch out the existing Security object in one of your _config.php files:
This is the "right" way to do it but does require some custom coding.
25 August 2009 at 9:48am
26 August 2009 at 12:07am
@dalesaurus Thank you. Yes, agree, I wanted to avoid modifying the framework itself. Using Security_lostpassword.ss works as suggested by Martijn.
@martijn Thanks. This works perfectly!
|Go to Top|