Everything is for free!
Shop is closed.
Due to health issues support is very limited

file Redirect based on group not working

More
2 years 5 months ago #10943 by steveorg
Redirect based on group not working was created by steveorg
Here's my code:

if($current_url=="index.php?option=com_revfetch&view=importform"
&& (in_array('16', $usergroups))
&& !(in_array('7', $usergroups))){
$redirect_menuitem_id = 1257;
}

The intent is that it redirects if the user belongs to group 16 but not group 7.

The page that displays is still index.php?option=com_revfetch&view=importform.

Please let me know what I'm doing wrong. Thanks.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #10946 by carsten888
Replied by carsten888 on topic Redirect based on group not working
put the ! right in front of inarray.
&& !in_array('7', $usergroups)){

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #10947 by steveorg
Replied by steveorg on topic Redirect based on group not working
Thanks. Sadly, it still does not work.

I tried it two ways:
Keeping: && (in_array('16', $usergroups))
Changing to: && in_array('16', $usergroups)

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #10950 by carsten888
Replied by carsten888 on topic Redirect based on group not working
$current_url is the url of the page where you login. Not where you land. Maybe that is the confusion?
Else double check in Redirect-on-Login > users-page if the user really belongs to 16 and not 7.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #10953 by steveorg
Replied by steveorg on topic Redirect based on group not working
$current_url is the issue. Is there a variable for the landing page?

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #10955 by carsten888
Replied by carsten888 on topic Redirect based on group not working
Sorry. My mistake. I totally overlooked about which extension we are talking here. I though as this was about redirecting you were using redirect-on-login, but this is dynamic-menu-links.

The script is executed when you click the link to the menu-item. So the current page is the page you are on when you click the link.

Maybe you can tell a bit more about what you want it to do, so we can think of a way to make this work.

Please Log in or Create an account to join the conversation.

Time to create page: 0.111 seconds
Powered by Kunena Forum
 
spicy-sacerdotal