diff --git a/Web/Presenters/AuthPresenter.php b/Web/Presenters/AuthPresenter.php index 90333151..4532df3a 100644 --- a/Web/Presenters/AuthPresenter.php +++ b/Web/Presenters/AuthPresenter.php @@ -92,6 +92,9 @@ final class AuthPresenter extends OpenVKPresenter $chUser = ChandlerUser::create($this->postParam("email"), $this->postParam("password")); if(!$chUser) $this->flashFail("err", "Не удалось зарегистрироваться", "Пользователь с таким email уже существует."); + + if (!strtotime($this->postParam("birthday")) < time()) + $this->flashFail("err", "Неверная дата рождения", "Дату рождения, которую вы ввели, не является корректным."); $user = new User; $user->setUser($chUser->getId()); @@ -101,6 +104,7 @@ final class AuthPresenter extends OpenVKPresenter $user->setEmail($this->postParam("email")); $user->setSince(date("Y-m-d H:i:s")); $user->setRegistering_Ip(CONNECTING_IP); + $user->setBirthday(strtotime($this->postParam("birthday"))); $user->save(); if(!is_null($referer)) { diff --git a/Web/Presenters/templates/Auth/Register.xml b/Web/Presenters/templates/Auth/Register.xml index 9ea387d7..9ae37b91 100644 --- a/Web/Presenters/templates/Auth/Register.xml +++ b/Web/Presenters/templates/Auth/Register.xml @@ -24,7 +24,7 @@

- +
+ + + +
@@ -54,6 +54,14 @@
+ {_"birth_date"}: + + +