CC-3970: Password Reset: No UI error msg for no mail server founded
-done
This commit is contained in:
parent
4077858c8e
commit
f433fd89fe
3 changed files with 19 additions and 6 deletions
|
@ -118,8 +118,12 @@ class LoginController extends Zend_Controller_Action
|
||||||
if (!empty($user)) {
|
if (!empty($user)) {
|
||||||
$auth = new Application_Model_Auth();
|
$auth = new Application_Model_Auth();
|
||||||
|
|
||||||
$auth->sendPasswordRestoreLink($user, $this->view);
|
$success = $auth->sendPasswordRestoreLink($user, $this->view);
|
||||||
|
if ($success) {
|
||||||
$this->_helper->redirector('password-restore-after', 'login');
|
$this->_helper->redirector('password-restore-after', 'login');
|
||||||
|
} else {
|
||||||
|
$form->email->addError($this->view->translate("Email could not be sent. Check your mail server settings and ensure it has been configured properly."));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$form->email->addError($this->view->translate("Given email not found."));
|
$form->email->addError($this->view->translate("Given email not found."));
|
||||||
|
|
|
@ -31,7 +31,9 @@ class Application_Model_Auth {
|
||||||
|
|
||||||
$message = "Click this link: {$e_link_protocol}://{$e_link_base}{$e_link_path}";
|
$message = "Click this link: {$e_link_protocol}://{$e_link_base}{$e_link_path}";
|
||||||
|
|
||||||
Application_Model_Email::send('Airtime Password Reset', $message, $user->getDbEmail());
|
$success = Application_Model_Email::send('Airtime Password Reset', $message, $user->getDbEmail());
|
||||||
|
|
||||||
|
return $success;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invalidateTokens($user, $action)
|
public function invalidateTokens($user, $action)
|
||||||
|
|
|
@ -12,6 +12,7 @@ class Application_Model_Email {
|
||||||
*/
|
*/
|
||||||
public static function send($subject, $message, $tos, $from = null)
|
public static function send($subject, $message, $tos, $from = null)
|
||||||
{
|
{
|
||||||
|
$success = true;
|
||||||
$mail = new Zend_Mail('utf-8');
|
$mail = new Zend_Mail('utf-8');
|
||||||
$mail->setSubject($subject);
|
$mail->setSubject($subject);
|
||||||
$mail->setBodyText($message);
|
$mail->setBodyText($message);
|
||||||
|
@ -21,6 +22,12 @@ class Application_Model_Email {
|
||||||
$mail->addTo($to);
|
$mail->addTo($to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
$mail->send();
|
$mail->send();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$success = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $success;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue