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: Adding permission for another user_id  (Read 3949 times)

0 Members and 1 Guest are viewing this topic.

eric.com.my

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
  • Eric Chooy
    • Eric's Heaven
Adding permission for another user_id
« on: June 10, 2005, 09:40:08 am »

I got a question over here. How do I define only admin, user_id 3 and user_id 8 that only have access with the coding below

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

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Adding permission for another user_id
« Reply #1 on: June 10, 2005, 09:56:33 am »

Code: [Select]
$accessArr = array(3,8);
if (!GALLERY_ADMIN_MODE && !in_array(USER_ID, $accessArr)) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

You may have any number of ids in the array whom you want the access.
Logged
Chief Geek at Ranium Systems

eric.com.my

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
  • Eric Chooy
    • Eric's Heaven
Re: Adding permission for another user_id
« Reply #2 on: June 10, 2005, 10:26:44 am »

Thank you Abbas Ali, it works perfectly. (https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fguestbook.eric.com.my%2Fimg%2Fsmilies%2Fnotworthy.gif&hash=54a87a98ab57e389fc8b7e69d59ff349c52fb4cf)
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 22 queries.