src/Auth.php
public function &user($user = null)
    {
        if($user) {
            $_SESSION[$this->params['session_key']] = $user;
        }
        else {
            if(!$this->check()) {
                throw new UserException('Not logged in', 403);
            }
        }


        return $_SESSION[$this->params['session_key']];
    }
public function &user($user = null)
    {
        if($user) {
            $_SESSION[$this->params['session_key']] = $user;
        }
        else {
            if(!$this->check()) {
                throw new UserException('Not logged in', 403);
            }
        }


        return $_SESSION[$this->params['session_key']];
    }
public function & user ( $ user = null ) { if ( $ user ) { $ _SESSION [ $ this -> params [ 'session_key' ] ] = $ user ; } else { if ( ! $ this -> check ( ) ) { throw new UserException ( 'Not logged in' , 403 ) ; } } return $ _SESSION [ $ this -> params [ 'session_key' ] ] ; }
Returns the current logged in user or sets the current login data
@param $user array
@return array user data
@throws UserException if noone is logged in
Returns the current logged in user or sets the current login data