Changeset 2391 for trunk/modules/auth

Show
Ignore:
Timestamp:
03/31/2008 03:06:27 PM (8 months ago)
Author:
Shadowhand
Message:

Removed the $user->has_role('login') check from Auth::login(). This check needs to be done by the developer, rather than by Auth.

Location:
trunk/modules/auth
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/auth/controllers/auth_demo.php

    r2388 r2391  
    8686 
    8787                                // Attempt a login 
    88                                 if ($this->auth->login($user, $form->password->value)) 
     88                                if ($user->has_role('login') AND $this->auth->login($user, $form->password->value)) 
    8989                                { 
    9090                                        echo '<h4>Login Success!</h4>'; 
  • trunk/modules/auth/libraries/Auth.php

    r2389 r2391  
    109109                $password = $this->hash_password($password, $this->find_salt($user->password)); 
    110110 
    111                 // If the user has the "login" role and the passwords match, perform a login 
    112                 if ($user->has_role('login') AND $user->password === $password) 
     111                // If the passwords match, perform a login 
     112                if ($user->password === $password) 
    113113                { 
    114114                        if ($remember === TRUE) 
     
    148148                        $user = new User_Model($token->user_id); 
    149149 
    150                         if ($token->id != 0 AND $user->id != 0) 
     150                        if ($token->id > 0 AND $user->id > 0) 
    151151                        { 
    152152                                if ($token->user_agent === sha1(Kohana::$user_agent))