Make a user only admin on certain site's Make a user only admin on certain site's
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Make a user only admin on certain site's

Started by rgroen, October 18, 2004, 07:04:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rgroen

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.

Joachim Müller

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

rgroen

Quote from: GauGau 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

Hey joachim,

Can you tell me wich statement this should be?

Thnx

Joachim Müller

example:if (!(GALLERY_ADMIN_MODE) && USER_NAME != 'john doe') {
     cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
}

Joachim