Skip to content

Commit

Permalink
Merge pull request #24 from pulse-studio/master
Browse files Browse the repository at this point in the history
Редирект если залогинен из LoginView.php…
  • Loading branch information
osben authored Feb 19, 2020
2 parents afc9cfe + bb8f999 commit 9fbacf1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions design/default/html/password_remind.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

{* Канонический адрес страницы *}
{$canonical="/user/password_remind" scope=root}
{$meta_title = "Напоминание пароля" scope=root}

{if $email_sent}
<h1>Вам отправлено письмо</h1>
Expand Down
4 changes: 4 additions & 0 deletions view/LoginView.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public function fetch()
unset($_SESSION['user_id']);
header('Location: ' . $this->config->root_url, true, 302);
exit();
} // Если авторизован
elseif ($this->user) {
header('Location: '.$this->config->root_url.'/user', true, 302);
exit();
} // Вспомнить пароль
elseif ($this->request->get('action') == 'password_remind') {
// Если запостили email
Expand Down
5 changes: 5 additions & 0 deletions view/RegisterView.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ class RegisterView extends View
{
public function fetch()
{
if ($this->user) {
header('Location: '.$this->config->root_url.'/user', true, 302);
exit();
}

$default_status = 1; // Активен ли пользователь сразу после регистрации (0 или 1)

if ($this->request->method('post') && $this->request->post('register')) {
Expand Down

0 comments on commit 9fbacf1

Please sign in to comment.