Saturday, June 5, 2010

Check if User Logged in Joomla 1.5 x

Use the code below to check if a user is logged in. This is useful if you want to only show certain parts of your component to registered users and not non-registred users. Have fun.

$user =&JFactory::getUser();
     if($user->id)
    {
    //do user logged in stuff
      }
    else
    {
    //do user not logged in stuff
      }
?>

1 comment:

  1. Thanks for the give little information about joomla. keep it more information. Joomla Development

    ReplyDelete