You are here:Home » website » Joomla: Redirect ke halaman tertentu jika belum login (guest)

Joomla: Redirect ke halaman tertentu jika belum login (guest)

$user = JFactory::getUser();
$mainframe = JFactory::getApplication();
if($user->id > 0){

JFactory::getApplication()->redirect('registered user url', $error, 'error' );
}
else{
JFactory::getApplication()->redirect(JURI::base().'index.php?option=com_users&view=login', $error, 'error' ); //redirect to login page
}
semoga terbantu :)

sumber

0 komentar: