Changeset 2024
- Timestamp:
- 02/10/2008 12:22:20 PM (10 months ago)
- Files:
-
- 1 modified
-
trunk/modules/auth/libraries/Auth.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/auth/libraries/Auth.php
r1717 r2024 64 64 65 65 /** 66 * Check if there is an active session. Optionally allows checking for a 67 * specific role. 68 * 69 * @param string role name 70 * @return boolean 71 */ 72 public function logged_in($role = NULL) 73 { 74 // Check if the user_id is present in the session 75 $status = ! empty($_SESSION['user_id']); 76 77 if ($status === TRUE AND ! empty($role)) 78 { 79 // Check if the user has the given role 80 $status = in_array($role, $_SESSION['roles']); 81 } 82 83 return $status; 84 } 85 86 /** 66 87 * Attempt to log in a user by using an ORM object and plain-text password. 67 88 *
