Saturday, August 1, 2009

make a component acess private(restricted to logged in users) in joomla 1.5

in the controller of the component write $user = &JFactory::getUser();
// echo "user id is ".$user->id ;

if ($user->id == 0) {

$this->setRedirect('index.php?option=com_user', 'This area is for registered users','message');
}

in any function

1 comment:

Unknown said...

That's great Basit bhai :)