Restrict access to the gallery for groups Restrict access to the gallery for groups
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Restrict access to the gallery for groups

Started by Naif, June 04, 2007, 05:13:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Naif

Hello everybody!

I know there is this setting in the Configuration: "Allow unlogged users (guest or anonymous) access", where you can choose either "Yes" or "No".

I'm just wondering, is there any way to allow access only to users who are included in special groups, and block it to the rest (guests and registered users)? I know that this could be done by setting this propierty in all of the albums, but is it possible to do it more quickly somehow?

Thanks!

BT-loader

Quote from: Naif on June 04, 2007, 05:13:54 PM
Hello everybody!

I know there is this setting in the Configuration: "Allow unlogged users (guest or anonymous) access", where you can choose either "Yes" or "No".

I'm just wondering, is there any way to allow access only to users who are included in special groups, and block it to the rest (guests and registered users)? I know that this could be done by setting this propierty in all of the albums, but is it possible to do it more quickly somehow?

Thanks!
I´m wondering the same thing.
:: BT-loader ::
"The one and only..."

Stramm

read the old CPG 1.3 faq about unlogged user access
http://coppermine-gallery.net/demo/cpg13x/docs/faq.htm#registeredUsersOnly
that's pretty much what you need. You just need to adopt the code a lil bit

$USER_DATA['groups'][0]
holds the first group id a user is in

so it'll look for example like
if ($USER_DATA['groups'][0] == 2){
cpg_die(ERROR, 'You do not have access to the gallery', __FILE__, __LINE__);
}