Page 1 of 1

acl for a frontend page

Posted: Fri Sep 14, 2007 1:26 pm
by linpi
I woul'd like to restrict a page from a component in the frontend, for Registered user only , not over a menu button, over a link like:
... myhomepage/component/option,com_seminar/task,register/

I found in backend files the following example:

Code: Select all

if (!($acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'all' )
| $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'com_comprofiler' ))) {
   mosRedirect( 'index2.php', _NOT_AUTH );
}

how to modify these lines for only registered user (not administration) ?
or is there a simpler way of doing this?
I'm using Joomla 1.0.13.
thank you for some tips. Pierre

Re: acl for a frontend page

Posted: Tue Sep 18, 2007 4:03 pm
by linpi
I found a very easy way to restrict a front page to only registered user:

Code: Select all

if ($my->id == 0) {
   // user is not registered if user id is 0
   echo '<p>You have to login before you an see this page!</p>';
} else {


cheers Pierre