diff --git a/classes/kohana/auth/orm.php b/classes/kohana/auth/orm.php index 26581a0..593e66c 100644 --- a/classes/kohana/auth/orm.php +++ b/classes/kohana/auth/orm.php @@ -117,9 +117,10 @@ protected function _login($user, $password, $remember) * Forces a user to be logged in, without specifying a password. * * @param mixed username string, or user ORM object + * @param boolean mark the session as forced * @return boolean */ - public function force_login($user) + public function force_login($user, $mark_session_as_forced = FALSE) { if ( ! is_object($user)) { @@ -130,8 +131,11 @@ public function force_login($user) $user->where($user->unique_key($username), '=', $username)->find(); } - // Mark the session as forced, to prevent users from changing account information - $this->_session->set('auth_forced', TRUE); + if ($mark_session_as_forced === TRUE) + { + // Mark the session as forced, to prevent users from changing account information + $this->_session->set('auth_forced', TRUE); + } // Run the standard completion $this->complete_login($user);