module user - action executeForgot
public function executeForgot()
{
... //check email
if($email) {
... // generate new password
$raw_email = $this->getController()-
>getPresentationFor('mail', 'forgottenPassword');
$this->getUser()->setFlash('message', "Your new password has
been sent.");
$this->redirect('@homepage');
}
else
{
$this->getUser()->setFlash('message', "Email address not
registered");
$this->redirect('@register');
} } }
module mail - action executeForgot
class mailActions extends sfActions
{
public function executeForgottenPassword()
{
$title='New Password - tReds';
$this->new_password = $this->getRequest()-
>getAttribute('new_password');
//sfMailer (swiftMailer)
$mailer = $this->getMailer();
$message = $mailer->compose();
$message->setSubject($title);
$message->setTo($this->getRequest()->getAttribute('email'));
$message->setFrom(sfConfig::get('app_mail_sender_email'),
sfConfig::get('app_mail_sender_name'));
$message->setBody($this->getPartial('forgottenPassword'), 'text/
html');
$mailer->send($message);
}
} }
module mail - template _forgottenPassword.php
<p>This email contains your new password that was requested from
website.</p>
<p style="font-family: Arial;">Your new password is: <?php echo
$new_password ?></p>
<p style="font-family: Arial;">After you login you can change it from
your personal settings</p>
When I call module user, action executeForgot - letter send, but
error:
The template "forgottenPasswordSuccess.php" does not exist or is
unreadable in "".
I create a template "forgottenPasswordSuccess.php" (empty).
When I call the module user, action executeForgot: letter send,
redirect empty "forgottenPasswordSuccess.php" and redirect @homepage
and displays "Your new password has been sent."
I added in action executeForgot
$this->setLayout(false);
$this->setTemplate(false);
return sfView::NONE;
but still redirect empty "forgottenPasswordSuccess.php"
How to call the action from another action or disable template
"forgottenPasswordSuccess.php".
P.S. Sorry for my mistakes. My English is not good enough.
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en