Check if user is logged in 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
    }
  • Share post

A collection of particles named Tali Luvhengo

19 comments

Leave a Reply to Bradley Cancel reply

Your email address will not be published. Required fields are marked *

Page optimized by WP Minify WordPress Plugin