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

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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__);
}