diff --git a/~dev_rating/application/classes/Controller/Handler/Sign.php b/~dev_rating/application/classes/Controller/Handler/Sign.php index d7000893dda6f4a53770d30a5f048b68591fc7db..5612f5ead62aad737f5e61d006256bf37c31a37b 100644 --- a/~dev_rating/application/classes/Controller/Handler/Sign.php +++ b/~dev_rating/application/classes/Controller/Handler/Sign.php @@ -81,9 +81,14 @@ class Controller_Handler_Sign extends Controller_Handler { if(Account::instance()->isMailExists($email)) { Account::instance()->createRecoveryRequest($this->post->offsetGet('email')); + $response['success'] = true; } - $response['success'] = true; + else + $response['error'] = 'Пользователь с таким e-mail адресом не зарегистрирован в системе!'; } + else + $response['error'] = 'Введенная строка не является e-mail адресом!'; + $this->response->body(json_encode($response)); } diff --git a/~dev_rating/application/views/sign/up.twig b/~dev_rating/application/views/sign/up.twig index 9f854c6d4854a8d807d95b701e057c0890b329f6..aef48d40ec62722725166704cc3938bf049382b4 100644 --- a/~dev_rating/application/views/sign/up.twig +++ b/~dev_rating/application/views/sign/up.twig @@ -2,13 +2,11 @@ {% block title %}Активация аккаунта{% endblock %} {% block forms %} - <div> - {{ sign.input('activation_code', 'text', '', 'Код активации') }} - {{ sign.input('login', 'text', '', 'Логин') }} - {{ sign.input('password', 'password', '', 'Пароль') }} - {{ sign.input('confirm_password', 'password', '', 'Подтверждение пароля') }} - {{ sign.input('email', 'text', '', 'E-Mail адрес') }} - </div> + {{ sign.input('activation_code', 'text', '', 'Код активации') }} + {{ sign.input('login', 'text', '', 'Логин') }} + {{ sign.input('password', 'password', '', 'Пароль') }} + {{ sign.input('confirm_password', 'password', '', 'Подтверждение пароля') }} + {{ sign.input('email', 'text', '', 'E-Mail адрес') }} {{ sign.input('signup_b', 'button', 'Активировать') }} <div class='footer'> {{ HTML.anchor('sign/in', 'Войти в существующий аккаунт')|raw }} diff --git a/~dev_rating/media/js/sign.js b/~dev_rating/media/js/sign.js index 55617a532364622edfe0373705431faf64beadb2..de7e9acb31c6d59e86d13f64db42018dae9d6dd3 100644 --- a/~dev_rating/media/js/sign.js +++ b/~dev_rating/media/js/sign.js @@ -33,7 +33,7 @@ $(function() } else { - $('#remind').val('Что-то пошло не так :('); + EventInspector_ShowMsg(data.error, "error"); } }); @@ -113,6 +113,10 @@ $(function() { $('#signin_b').trigger('click'); } + else if($('#email').is(':focus')) + { + $('#email').siblings('input[type=button]').trigger('click'); + } } });