问题
I have created my website in Joomla. In my site I have created 3 user groups ('guest', 'unregistered', 'registered'), and I have created one blog kind of thing called abstract corner in article. The 'guest' and 'unregistered' user can just view the guidelines but they can't submit the abstracts. The 'registered' user can submit abstracts. I am using two images to display "abstract guidelines" and an "abstract submission" link. How can I redirect this user to particular article?
Please help me. I am new to Joomla .
回答1:
here is a solution :
1.first you need to find out user group id
$user = JFactory::getUser();
$groups = $user->get('groups');
foreach($groups as $group) {
if ($group==3)//ex: group id is 3 for registered user
{
echo"redirect page 1";
}else{
echo "redirect page 2";
}
}
来源:https://stackoverflow.com/questions/27873774/how-to-redirect-the-user-according-to-their-user-groups-in-joomla