How to prevent access from certain groups (Invision related) How to prevent access from certain groups (Invision related)
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

How to prevent access from certain groups (Invision related)

Started by smarko, December 06, 2004, 03:58:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

smarko

How can I prevent certain groups (Invision bridged Coppermine) from accessing galleries? Like groups validating, guests and banned? I know, that I can check if user is logged in, but it's not quite enough..

if (USER_ID){

} else {
{
    $redirect = $redirect . "loginplease.php";
   header("Location: $redirect");

    exit();
}}

smarko

Never mind. I figured it out myself. Group id 1 and 5 are for validating and banned users.

if (USER_ID)
{
 if (($USER_DATA['group_id'] == "1") || ($USER_DATA['group_id'] == "5"))
   {
     $redirect = $redirect . "messagetext.html";
     header("Location: $redirect");
     exit();
   }
}
else {
 redirect = $redirect . "messagetext.html";
 header("Location: $redirect");
 exit();
}

chaggydawg

small typo, should be:


if (USER_ID)
{
 if (($USER_DATA['group_id'] == "1") || ($USER_DATA['group_id'] == "5"))
   {
     $redirect = $redirect . "messagetext.html";
     header("Location: $redirect");
     exit();
   }
}
else {
 $redirect = $redirect . "messagetext.html";
 header("Location: $redirect");
 exit();
}