diff --git a/upload/language/ru_RU/ajax.php b/upload/language/ru_RU/ajax.php index a2e09a1..18ffefc 100644 --- a/upload/language/ru_RU/ajax.php +++ b/upload/language/ru_RU/ajax.php @@ -64,20 +64,6 @@ 'new_success_del' => 'Новость успешно удалена', - 'reg_e_login_regexp' => 'Логин может состоять только из латинских букв, цифр и знаков -_', - 'reg_e_email_regexp' => 'Неверный формат E-Mail адреса', - 'reg_e_exist' => 'Запрещено использовать данный логин и/или E-Mail', - 'reg_e_pass_length' => 'Пароль должен быть не менее 6-ти символов', - 'reg_e_pass_match' => 'Пароли не совпадают', - 'reg_e_rules' => 'Необходимо принять правила сайта', - "reg_e_rules" => "Для регистрации необходимо принять правила", - "reg_e_success" => "Вы успешно зарегистрировались. Теперь вы можете войти под своим логином и паролем.", - "reg_e_success_mail" => "Письмо с подтверждением регистрации отправлено на E-Mail, указанный при регистрации", - "reg_e_already" => "Вы уже зарегистрированы", - "reg_title" => "[Регистрация]", - 'reg_ok' => 'ОК', - "log_reg" => "Регистрация пользователя", - 'log_new_del' => 'Удаление новости', 'log_com_add' => 'Добавление комментария', 'log_com_edit' => 'Редактирование комментария', diff --git a/upload/language/ru_RU/register.php b/upload/language/ru_RU/register.php index 9fa3eb1..f480764 100644 --- a/upload/language/ru_RU/register.php +++ b/upload/language/ru_RU/register.php @@ -13,6 +13,17 @@ "msg3" => "Для подтверждения регистрации, перейдите по ссылке ниже", "msg4" => "Если это были не вы, то проигнорируйте данное сообщение.", "msg5" => "С уважением, администрация сайта", + "e_rules" => "Для регистрации необходимо принять правила", + 'e_login_regexp' => 'Логин может состоять только из латинских букв, цифр и знаков -_', + 'e_email_regexp' => 'Неверный формат E-Mail адреса', + 'e_exist' => 'Запрещено использовать данный логин и/или E-Mail', + 'e_pass_length' => 'Пароль должен быть не менее 6-ти символов', + 'e_pass_match' => 'Пароли не совпадают', + "log_reg" => "Регистрация пользователя", + "reg_title" => "[Регистрация]", + "e_success" => "Вы успешно зарегистрировались. Теперь вы можете войти под своим логином и паролем.", + "e_success_mail" => "Письмо с подтверждением регистрации отправлено на E-Mail, указанный при регистрации", + 'reg_ok' => 'ОК', ); ?> \ No newline at end of file diff --git a/upload/modules/ajax/register.php b/upload/modules/ajax/register.php index 739526f..1aa0fe9 100644 --- a/upload/modules/ajax/register.php +++ b/upload/modules/ajax/register.php @@ -10,24 +10,27 @@ $this->db = $core->db; $this->config = $core->config; $this->user = $core->user; - $this->lng = $core->lng_m; + + require_once(MCR_LANG_DIR.'register.php'); + + $this->lng = $core->lng_m = $lng; } public function content(){ if($_SERVER['REQUEST_METHOD']!='POST'){ $this->core->js_notify($this->core->lng['e_hack']); } - if($this->user->is_auth){ $this->core->js_notify($this->lng['reg_e_already']); } + if($this->user->is_auth){ $this->core->js_notify($this->lng['e_already']); } $login = $this->db->safesql(@$_POST['login']); $email = $this->db->safesql(@$_POST['email']); $uuid = $this->db->safesql($this->user->logintouuid(@$_POST['login'])); $password = @$_POST['password']; - if(intval($_POST['rules'])!==1){ $this->core->js_notify($this->lng['reg_e_rules']); } + if(intval($_POST['rules'])!==1){ $this->core->js_notify($this->lng['e_rules']); } - if(!preg_match("/^[\w\-]{3,}$/i", $login)){ $this->core->js_notify($this->lng['reg_e_login_regexp']); } - if(!filter_var($email, FILTER_VALIDATE_EMAIL)){ $this->core->js_notify($this->lng['reg_e_email_regexp']); } + if(!preg_match("/^[\w\-]{3,}$/i", $login)){ $this->core->js_notify($this->lng['e_login_regexp']); } + if(!filter_var($email, FILTER_VALIDATE_EMAIL)){ $this->core->js_notify($this->lng['e_email_regexp']); } $query = $this->db->query("SELECT COUNT(*) FROM `mcr_users` WHERE login='$login' OR email='$email'"); @@ -35,11 +38,11 @@ $ar = $this->db->fetch_array($query); - if($ar[0]>0){ $this->core->js_notify($this->lng['reg_e_exist']); } + if($ar[0]>0){ $this->core->js_notify($this->lng['e_exist']); } - if(mb_strlen($password, "UTF-8")<6){ $this->core->js_notify($this->lng['reg_e_pass_length']); } + if(mb_strlen($password, "UTF-8")<6){ $this->core->js_notify($this->lng['e_pass_length']); } - if($password !== @$_POST['repassword']){ $this->core->js_notify($this->lng['reg_e_pass_match']); } + if($password !== @$_POST['repassword']){ $this->core->js_notify($this->lng['e_pass_match']); } if(!$this->core->captcha_check()){ $this->core->js_notify($this->core->lng['e_captcha']); } @@ -99,10 +102,10 @@ if(!$this->core->send_mail($email, $this->lng['reg_title'], $message)){ $this->core->js_notify($this->core->lng['e_sql_critical']); } - $this->core->js_notify($this->lng['reg_e_success_mail'], $this->core->lng['e_success'], true); + $this->core->js_notify($this->lng['e_success_mail'], $this->core->lng['e_success'], true); } - $this->core->js_notify($this->lng['reg_e_success'], $this->core->lng['e_success'], true); + $this->core->js_notify($this->lng['e_success'], $this->core->lng['e_success'], true); } }