forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Permissions & Access Rights => Topic started by: eric.com.my on June 10, 2005, 09:40:08 am

Title: Adding permission for another user_id
Post by: eric.com.my 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__);
Title: Re: Adding permission for another user_id
Post by: Abbas Ali 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.
Title: Re: Adding permission for another user_id
Post by: eric.com.my 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)