Changeset 3484 for trunk/modules/auth

Show
Ignore:
Timestamp:
09/25/2008 12:56:53 PM (2 months ago)
Author:
Shadowhand
Message:

Added Auth::get_user(), returns the currently logged-in user. Fixes #842.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/auth/classes/auth.php

    r3458 r3484  
    8989 
    9090        /** 
     91         * Returns the currently logged in user, or FALSE. 
     92         * 
     93         * @return  mixed 
     94         */ 
     95        public function get_user() 
     96        { 
     97                if ($this->driver->logged_in(NULL)) 
     98                { 
     99                        return Session::instance()->get('auth_user', FALSE); 
     100                } 
     101 
     102                return FALSE; 
     103        } 
     104 
     105        /** 
    91106         * Attempt to log in a user by using an ORM object and plain-text password. 
    92107         *