SAAS-781 - Code review fixes

This commit is contained in:
Duncan Sommerville 2015-07-28 11:47:53 -04:00
commit 75aef986ea
3 changed files with 43 additions and 40 deletions

View file

@ -158,19 +158,21 @@ class LoginController extends Zend_Controller_Action
}
$user = $query->findOne();
if (!empty($user)) {
$auth = new Application_Model_Auth();
if (!empty($user)) {
$auth = new Application_Model_Auth();
$success = $auth->sendPasswordRestoreLink($user, $this->view);
if ($success) {
$this->_helper->redirector('password-restore-after', 'login');
$success = $auth->sendPasswordRestoreLink($user, $this->view);
if ($success) {
$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 {
$form->email->addError($this->view->translate(_("There was a problem sending the recovery email.")));
}
} else {
$form->email->addError($this->view->translate(_("We couldn't find the email you entered - you can also try <a href='https://account.sourcefabric.com/pwreset.php'>here</a>.")));
$form->email->addError($this->view->translate(_("We couldn't find the email you entered - you can also try <a href='".WHMCS_PASSWORD_RESET_URL."'>here</a>.")));
}
}
$this->view->form = $form;
}