Kohana_Auth_ORM::force_login PHP Method

force_login() public method

Forces a user to be logged in, without specifying a password.
public force_login ( $user, $mark_session_as_forced = FALSE ) : boolean
return boolean
    public function force_login($user, $mark_session_as_forced = FALSE)
    {
        if (!is_object($user)) {
            $username = $user;
            // Load the user
            $user = ORM::factory('user');
            $user->where($user->unique_key($username), '=', $username)->find();
        }
        if ($mark_session_as_forced === TRUE) {
            // Mark the session as forced, to prevent users from changing account information
            $this->_session->set($this->_config['forced_key'], TRUE);
        }
        // Run the standard completion
        $this->complete_login($user);
    }