Немного маленьких исправлений — чистка старых путей.

This commit is contained in:
Alexander Yakovlev 2011-07-31 10:27:17 +07:00
parent 491c2321da
commit 89b42198c9
2 changed files with 3 additions and 9 deletions

View file

@ -3,17 +3,11 @@
class Controller_Login extends Controller_Template { class Controller_Login extends Controller_Template {
public $template = 'login'; public $template = 'login';
public function action_view() { public function action_view() {
if(Auth::instance()->logged_in()){ if(Auth::instance()->logged_in()) return $this->request->redirect('');
if (Auth::instance()->logged_in(array('admin')) === FALSE) return $this->request->redirect('events/view');
return $this->request->redirect('overview/view');
}
if ($_POST){ if ($_POST){
$user = ORM::factory('user'); $user = ORM::factory('user');
$status = Auth::instance()->login($_POST['login'], $_POST['password']); $status = Auth::instance()->login($_POST['login'], $_POST['password']);
if ($status){ if ($status) return $this->request->redirect('');
if (Auth::instance()->logged_in(array('admin')) === FALSE) return $this->request->redirect('events/view');
return $this->request->redirect('overview/view');
}
else $this->template->error = "Неверный логин или пароль."; else $this->template->error = "Неверный логин или пароль.";
} }
} }

View file

@ -1,5 +1,5 @@
</div> </div>
<div id="footer">Наши конкурсы -- самые быстрые конкурсы! Не доверяйте подделкам!<!--<?php echo $years ?>--></div> <div id="footer">Наши конкурсы самые быстрые конкурсы! Не доверяйте подделкам!<!--<?php echo $years ?>--></div>
</div> </div>
</body> </body>
</html> </html>