diff --git a/application/classes/controller/login.php b/application/classes/controller/login.php index 6a49bce..569f40a 100644 --- a/application/classes/controller/login.php +++ b/application/classes/controller/login.php @@ -3,17 +3,11 @@ class Controller_Login extends Controller_Template { public $template = 'login'; public function action_view() { - if(Auth::instance()->logged_in()){ - if (Auth::instance()->logged_in(array('admin')) === FALSE) return $this->request->redirect('events/view'); - return $this->request->redirect('overview/view'); - } + if(Auth::instance()->logged_in()) return $this->request->redirect(''); if ($_POST){ $user = ORM::factory('user'); $status = Auth::instance()->login($_POST['login'], $_POST['password']); - if ($status){ - if (Auth::instance()->logged_in(array('admin')) === FALSE) return $this->request->redirect('events/view'); - return $this->request->redirect('overview/view'); - } + if ($status) return $this->request->redirect(''); else $this->template->error = "Неверный логин или пароль."; } } diff --git a/application/views/footer.php b/application/views/footer.php index c2ced7d..7d36d2a 100644 --- a/application/views/footer.php +++ b/application/views/footer.php @@ -1,5 +1,5 @@ - +