coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: smarko on December 06, 2004, 03:58:19 PM

Title: How to prevent access from certain groups (Invision related)
Post by: smarko on December 06, 2004, 03:58:19 PM
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();
}}
Title: Re: How to prevent access from certain groups (Invision related)
Post by: smarko on December 08, 2004, 03:38:36 AM
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();
}
Title: Re: How to prevent access from certain groups (Invision related)
Post by: chaggydawg on April 02, 2005, 02:59:07 AM
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();
}