1
ackbarr: makes sense.
I have implemented this, and just so it is documented in the forums so someone else can find this with a search, the code I used was the following:
Quote:
I found that if I did not include the if(!empty($xoopsUser)) test, than no content would be displayed at all if the user wasn't logged in.
I have implemented this, and just so it is documented in the forums so someone else can find this with a search, the code I used was the following:
Quote:
global $xoopsUser;
if(!empty($xoopsUser)) {
$group = $xoopsUser->getGroups();
if (in_array(1, $group)) { //or whatever the groupid is
echo "you are authorized to view this material";
}
else {
echo "you are not authorized to view this material";
}
}
else
echo "not logged in";
I found that if I did not include the if(!empty($xoopsUser)) test, than no content would be displayed at all if the user wasn't logged in.