1
Is there a global variable for groups in Xoops?
I have some content that I want to prevent users not within specific groups from looking at. ALthough WFSections or something like that is an option, to make URLs simpler, as well as more control, I would rather force authentication based upon a callable variable.
I am able to require that the user logs in to see static content, per
the following thread.
I would think that it'd be an easy call to a global variable. I have found the following call in ./includes/common.php. Presumably this is an array:
Quote:
If this is the case, than i think the code would be something like this:
Quote:
global $xoopsUser;
foreach ($xoopsUser->getGroups() as $group) {
if (in_array(1, $group) //or whatever the groupid is
//display content
else
//redirect to user.php
}
What do you all think?
edit: I had in_array variables backwards.