Skip to content
Snippets Groups Projects
Commit 15332ffd authored by Anton Bagliy's avatar Anton Bagliy
Browse files

FIX: proper pop up message when account recovery fails, close #394

parent 647c668a
Branches issue394_passrecovery_message
No related merge requests found
......@@ -31,14 +31,21 @@ class Controller_Handler_Sign extends Controller_Handler
public function action_remindPassword() {
$this->post->rule('email', 'not_empty')->rule('email', 'email');
if (!$this->post->check())
$this->fail('Введенная строка не является <span>e‑mail</span> адресом!');
if (!Account::doesEmailExist($_POST['email']))
$this->fail('Пользователь с таким <span>e-mail</span> адресом не зарегистрирован в системе!');
Account::createRecoveryRequest($_POST['email']);
// http://gitlab.mmcs.sfedu.ru/it-lab/grade/issues/394
// чтобы не появлялась целая html-страница в popup
// здесь выдается только короткое текстовое сообщение
try {
Account::createRecoveryRequest($_POST['email']);
} catch(Exception $exception) {
$this->fail('Ошибка с кодом ' . $exception->getCode() . ': ' . $exception->getMessage());
}
}
public function action_changePassword() {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment