Changeset 3273 for trunk/modules

Show
Ignore:
Timestamp:
08/06/2008 08:12:28 AM (4 months ago)
Author:
Shadowhand
Message:

More optimizations to Auth/ORM

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/auth/libraries/drivers/Auth/ORM.php

    r3267 r3273  
    4545                        { 
    4646                                // Check that the user has the given role 
    47                                 $status = $_SESSION['auth_user']->has('role', $role); 
     47                                $status = $_SESSION['auth_user']->has(new Role_Model($role)); 
    4848                        } 
    4949                } 
     
    6161 
    6262                // If the passwords match, perform a login 
    63                 if ($user->has(ORM::factory('role', 'login')) AND $user->password === $password) 
     63                if ($user->has(new Role_Model('login')) AND $user->password === $password) 
    6464                { 
    6565                        if ($remember === TRUE) 
     
    109109                        $token = ORM::factory('user_token', $token); 
    110110 
    111                         if ($token->id > 0 AND $token->user->id > 0) 
     111                        if ($token->loaded AND $token->user->loaded) 
    112112                        { 
    113113                                if ($token->user_agent === sha1(Kohana::$user_agent))