I used to use this code to control access in V3
it worked great but now when i use it in V4 it just acts as a redirect, so even when a user is logged in it still redirects them.
any one have a fix for this?
<?php
$user =& JFactory::getUser();
if ( !$user->gid ) {
$mainframe =& JFactory::getApplication();
$mainframe->redirect('index.php', 'You are not allowed to access this page', 'error');
}
?>
it worked great but now when i use it in V4 it just acts as a redirect, so even when a user is logged in it still redirects them.
any one have a fix for this?