In Joomla 1.0, the current User object was stored in a global variable called $my
. This doesn't exist in Joomla 1.5 any more - how do I get that object? Also, how can you tell if the user hasn't logged in?
views:
598answers:
1
+3
A:
Information found at http://docs.joomla.org/Accessing_the_current_user_object
$user =& JFactory::getUser();
And how to tell if they've logged in, or if they're just a guest:
if ($user->guest) {
echo "Please log in.";
} else {
echo "Welcome!";
}
nickf
2008-11-14 02:25:09