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: Make a user only admin on certain site's  (Read 2985 times)

0 Members and 1 Guest are viewing this topic.

rgroen

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
Make a user only admin on certain site's
« on: October 18, 2004, 07:04:54 pm »

Hey,

Everone knows the following code:

if (!(GALLERY_ADMIN_MODE)) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

But how can I make my script in that way so I can give users permission to visit some page's.

I want to give a person rights to visit one page but dont want to give him the rights for administration.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Make a user only admin on certain site's
« Reply #1 on: October 18, 2004, 07:15:40 pm »

add another switch condition into the if statement, separated with boolean operators OR (||) or AND (&&). Depending on the stuff you want to allow, you may have to add such switches in different files.

Joachim
Logged

rgroen

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
Re: Make a user only admin on certain site's
« Reply #2 on: October 18, 2004, 07:27:48 pm »

add another switch condition into the if statement, separated with boolean operators OR (||) or AND (&&). Depending on the stuff you want to allow, you may have to add such switches in different files.

Joachim

Hey joachim,

Can you tell me wich statement this should be?

Thnx
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Make a user only admin on certain site's
« Reply #3 on: October 18, 2004, 11:02:43 pm »

example:
Code: [Select]
if (!(GALLERY_ADMIN_MODE) && USER_NAME != 'john doe') {
     cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
}
Joachim
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.