Skip to content

Commit

Permalink
implement #3133 (marking forced logins should be optional)
Browse files Browse the repository at this point in the history
  • Loading branch information
biakaveron committed Sep 16, 2010
1 parent eb30119 commit 5c8cf95
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions classes/kohana/auth/orm.php
Expand Up @@ -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))
{
Expand All @@ -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);
Expand Down

0 comments on commit 5c8cf95

Please sign in to comment.