Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Restrict access to the gallery for groups  (Read 2843 times)

0 Members and 1 Guest are viewing this topic.

Naif

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Restrict access to the gallery for groups
« 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!
Logged

BT-loader

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 102
Re: Restrict access to the gallery for groups
« Reply #1 on: June 15, 2007, 07:01:39 am »

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.
Logged
:: BT-loader ::
"The one and only..."

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Restrict access to the gallery for groups
« Reply #2 on: June 15, 2007, 11:15:28 am »

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

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

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

Page created in 0.02 seconds with 16 queries.