Everything is for free!
Shop is closed.
Due to health issues support is very limited
Shop is closed.
Due to health issues support is very limited
Redirect based on group not working
- steveorg
- Offline
Less
More
- Posts: 3
3 years 2 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.
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.
- carsten888
- Offline
Less
More
- Posts: 4792
3 years 2 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.
- steveorg
- Offline
Less
More
- Posts: 3
3 years 2 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)
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.
- carsten888
- Offline
Less
More
- Posts: 4792
3 years 2 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.
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.
- steveorg
- Offline
Less
More
- Posts: 3
3 years 2 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.
- carsten888
- Offline
Less
More
- Posts: 4792
3 years 2 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.
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.108 seconds