1779 Posts in 582 Topics by 556 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1417 Views |
-
Security/changepassword Redirect?

27 January 2010 at 12:13am
Hi Guys
Security/changepassword upon completion redirects to Security/login. This is quite redundant as the user would already be logged in. Is there any wat to change this page to Redirect home for example. I attempted BackURL in the form action without joy.
Any assistance would be appreciated.
-
Re: Security/changepassword Redirect?

30 June 2010 at 1:05am
Hi
You can make a custom class that extends ChangePasswordForm.php – and override the doChangePassword-function. Inside this function there is a line which redirects the user.
Joel
-
Re: Security/changepassword Redirect?

11 January 2011 at 2:47pm
Actually currently (2.4.3) you can extend ChangePasswordForm and then use Object::useCustomClass as joel suggests, but it will not be picked up.
The above method works fine for MemberLoginForm as when that is called in MemberAuthenticator it uses Object::create instead of new MemberLoginForm.
The work around is to fix Security line 589 which in my opinion should use Object::create not new ChangePasswordForm.
However since its A VERY BAD IDEA TO EDIT THE CORE, simple create a new class called CustomSecurity which extends Security and then add a rule in mysite/config.php
Director::addRules(11, array(
'Security//$Action/$ID/$OtherID' => 'CustomSecurity',
));The rule above overrides the rule in Sapphire/_config because the priority is 11 which outranks 10.
-
Re: Security/changepassword Redirect?

11 January 2011 at 2:53pm
class CustomSecurity extends Security {
/**
* Factory method for the lost password form
*
* @return Form Returns the lost password form
*/
public function ChangePasswordForm() {
return Object::create('ChangePasswordForm', $this, 'ChangePasswordForm');
}}
| 1417 Views | ||
|
Page:
1
|
Go to Top |



