Redirector::dashboard PHP Method

dashboard() public method

Redirect to the dashboard
public dashboard ( )
    public function dashboard()
    {
        return $this->to(PUBLIC_ROOT . "User");
    }

Usage Example

Exemplo n.º 1
0
 /**
  * login form
  *
  */
 public function index()
 {
     //check first if user is already logged in via session or cookie
     if ($this->Auth->isLoggedIn()) {
         Redirector::dashboard();
     } else {
         //clear and regenerate session and cookies(instead of using the existing one in browser),
         //then show login form.
         //But, this won't allow user(un-trusted) to open more than one login form,
         //because every time it loads, it generates a new CSRF Token
         //So, keep it commented
         //$this->login->logOut(Session::getUserId(), true);
         echo $this->view->renderWithLayouts(Config::get('LOGIN_PATH'), Config::get('LOGIN_PATH') . "index.php");
     }
 }