Ejemplo n.º 1
0
 /**
  * Index, default action (shows the login form), when you do login/index
  */
 public function index()
 {
     // if user is logged in redirect to main-page, if not show the view
     if (LoginModel::isUserLoggedIn()) {
         Redirect::home();
     } else {
         $data = array('redirect' => Request::get('redirect') ? Request::get('redirect') : NULL);
         $this->View->render('login/index', $data);
     }
 }