How to get the current user object in Joomla 1.5?

In Joomla 1.0, the current custom object was stored in a global variable named $my

. This no longer exists in Joomla 1.5 - how do I get this object? Also, how can you tell if the user will enter?

0


source to share


1 answer


Information found at http://docs.joomla.org/Accessing_the_current_user_object

$user =& JFactory::getUser();

      



And how to tell if they are logged in, or if they are just a guest:

if ($user->guest) {
    echo "Please log in.";
} else {
    echo "Welcome!";
}

      

+5


source







All Articles