Hello,
I am currently doing my first site with SS and I am quite amazed but I have some minor problems.
I want to have a login form at the left on every page.
For that I added this to my Page.php:
/**
* Shows login Form
*
* @return Form
*/
function LeftLoginForm() {
return new LeftLoginForm($this, "LeftLoginForm", new FieldSet(
// Form fields
new EmailField("Email", "E-Mail"),
new PasswordField("Password", "Passwort")
));
}
I also created a class LeftLogiForm where I override dologin():
// this function is overloaded on our sublcass (this) to do something different
public function dologin($data) {
$this->performLogin($data);
// If this is left out the standard form will show inside content
// which causes the form handling to break
Director::redirectBack();
}
Inside my template I have $LeftLoginForm where the form should go to.
This works fine so far. All System messages are shown inside this form area, etc..
First question: Is this how it is intended to be done, or are there better ways?
Now here is the real problem:
If I click on 'Forgot my password' the form shows up inside the content area.
This form works, but the form on the left is broken because the form action changes to /Security/?executeForm=LeftLoginForm.
If I submit this form I end up with this error message:
user_error(Object::__call() Method 'LeftLoginForm' not found in class 'Security',256)
line 199 of Object.php
Object->__call(LeftLoginForm,Array)
[...]
What is happening here? What does executeForm do and how can I fix this problem?
Is it possible to show the forgot password form where the login form was?
Thanks in advance
Daniel Khan