Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

user group not work

user group not work

I tried to redirect based on user group and it is not work but if is set user ID directly it is works also when i put for ll logged in user it is works too, so just not work for specific user group

https://goo.gl/edc7nr

Could you help please

jacob.arlington
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: user group not work

I tested in my local works fine just not in amazon AWS, do i need any specific extension for this to works?

jacob.arlington
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: user group not work

Hi Jacob,

thanks for the bug report and the videos - very helpful.
It's very strange that this works on one site and not another. It's hard to imagine why this could be happening.
Can you tell me if the 2 sites are basically the same, or whether there are differences in what extensions are installed on each one?

To help diagnose the issue, you can use Debug mode in Chameleon. You'll find it in the Options panel in the Chameleon Rule Chain Manager page.

Once you have turned this on, repeat the test for the user group, and see what shows up in the Debug panel on the front end of your site. It should confirm whether the logged in user is in the selected group or not (or at least it will tell you what it THINKS which may be wrong).

The next debugging step would be to use the PHP tab in Chameleon to display some information about what group(s) the user is in. Try the following code, which will display some text at the top of the page. It may break the HTML of your page, but it's just for testing:

echo "<pre>";
$groups = $core_genius->info("groupids");
print_r($groups);
echo "</pre>";
return true;

On my standard testing server as a non logged in user, this displays:

Array
(
    [0] => 1
    [1] => 9
)

1 and 9 are the group ids for Public and Guest.
If I log in as a super user, it gives me 1 and 8 (super user)

So I wonder what values you get on your 2 sites? If the AWS server is giving out wrong group info, then that narrows down the issue to something in $core_genius. -- please let me know.

Cheers
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Re: user group not work

Hi - I finally found the issue. Since you were having trouble on 1 host and not another, it turns out to be a difference in PHP handling of some data.

Specifically, if you do a mb_strtolower() on an integer value, you expect it will implicitly convert it to a string before conversion. On your server, it doesn't: it converts it to "" blank string.

So I made a live change in a file in JomGenius on your site to force the arguments to strtolower to be strings.

I will make this change to the published version of Chameleon and MetaMod in the next few days, in case anyone else has these problems.

Meanwhile, this is now working properly on your site.

Thanks for reporting it.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Re: user group not work

So just to follow up: your particular PHP version on your live server, 7.0.27, has a bug in handling of mb_strtolower() when passed integer/numeric values. I couldn't replicate this on 7.1.7, for example.

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1685
Total Polls:
6
Total Posts:
5912
Total Posts Today:
4
User Info:
 
Total Users:
11504
Newest User:
toko solo
Members Online:
0
Guests Online:
137

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked