if (is_object($xoopsUser)) {
$sql = "SELECT uid FROM ".$xoopsDB->prefix("users")." WHERE uid NOT IN (1) AND NOT IN (34)";
$result = $xoopsDB->query($sql);
if ($result && $xoopsDB->getRowsNum($result) > 0) {
{
redirect_header(XOOPS_URL, 5, _NOPERM);
exit();
}
}
ghia wrote:if (is_object($xoopsUser)) {
$groups = $xoopsUser->getGroups();
} else {
$groups = XOOPS_GROUP_ANONYMOUS;
}
Then check if the required group is present.Then check $uid is the required one.if(is_object($xoopsUser)) {
$uid = $xoopsUser->getVar('uid');
}
else
{
$uid = 0;
}
if (!$userisok) {
redirect_header(XOOPS_URL.'/index.php', 3, _NOPERM);
exit();
}
<{if $xoops_isadmin}>
echo "test - admin see this";
<{/if}>
<{if !$xoops_isuser}>
echo "user see this";
<{/if}>
<{if $xoops_isadmin}> <!--condition if the real webmaster login-->
echo "what to do";
<{elseif $group_id == 4}>
//<!--condition if the other webmaster login ("4" is the id of the group created before)-->
echo "something to do if first condition is false and this condition is true";
<{/if}>
?>
ghia wrote:if (is_object($xoopsUser)) {
$groups = $xoopsUser->getGroups();
} else {
$groups = XOOPS_GROUP_ANONYMOUS;
}
Then check if the required group is present.Then check $uid is the required one.if(is_object($xoopsUser)) {
$uid = $xoopsUser->getVar('uid');
}
else
{
$uid = 0;
}
$xoopsUser or redirect_header('index.php', 3, _NOPERM);
what if i want to restrict view of this page by user ID or by group ?
I don't want anonymous visitor or any other registered user to visit this page
how do i do this ?