Topic: Simple access control using integration

Hi

I've used the instructions here to integrate with my site and just need a bit of help with authentication.

I use simple php if statement to see if the user trying to read a page is in the correct group, but what php command can I use if they are not?
Is there a simple 'kill' command that will prevent further rendering of the page or immediate redirection?
If they are in the correct group, I don't really want to have to surround the rest of the page in a php else clause.
Is there a simple elegant way of doing this?

Does that make sense?!!

Thanks

--Alan

Re: Simple access control using integration

PunBB's message() function?

Just put, for example:

if($pun_user['g_id'] > PUN_ADMIN)
     message($lang_common['No view']);

after you include the lang files, common.php, header.php, etc but before what you want to be displayed to certain people. Assuming "No view" is a valid lang entry, anyone but admins will receive an error message. No else {} is required.

Looking for a certain modification for your forum? Please take a look here before posting.

3 (edited by naitkris 2007-01-18 02:16)

Re: Simple access control using integration

Integrating PunBB to a site I am developing and I just use:

if($pun_user['group_id'] > PUN_ADMIN) {
   exit("Failure - ".$pun_user['username']." not permitted access.");
}

doing it this basic way I only need to call the common.php PunBB file for authentication and can use other header and footer files etc as needed.