Improve forget password behaviour

Notify the user that an email has been sent or not.
This commit is contained in:
Frederic Guillot
2017-01-29 20:47:00 -05:00
parent da3110ec8b
commit a5a9bd56b7
28 changed files with 108 additions and 2 deletions

View File

@@ -104,7 +104,7 @@ class PasswordResetController extends BaseController
*
* @param string $username
*/
private function sendEmail($username)
protected function sendEmail($username)
{
$token = $this->passwordResetModel->create($username);
@@ -117,13 +117,17 @@ class PasswordResetController extends BaseController
t('Password Reset for Kanboard'),
$this->template->render('password_reset/email', array('token' => $token))
);
$this->flash->success(t('A link to reset your password has been sent by email.'));
} else {
$this->flash->failure(t('Unfortunately, we are unable to reset your password. Did you entered a valid username? Do you have an email address in your profile?'));
}
}
/**
* Check feature availability
*/
private function checkActivation()
protected function checkActivation()
{
if ($this->configModel->get('password_reset', 0) == 0) {
throw AccessForbiddenException::getInstance()->withoutLayout();