Thursday, December 11, 2008

Auth Check in phpbb?


// Added for Extra permission MOD
// Start auth check
//
$is_auth = array();
$is_auth = auth(AUTH_ALL, PAGE_VIEWMEMBERS, $userdata);

if( !$is_auth['auth_read'] )
{
if ( !$userdata['session_logged_in'] )
{
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ?
"Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=memberlist.$phpEx", true));
exit;
}
$message = ( !$is_auth['auth_view'] ) ? $lang['Not_Authorised'] :
sprintf ($lang['Sorry_no_auth'],$is_auth['auth_read_type']);
message_die(GENERAL_MESSAGE, $message);
}
//
// End auth check
//



Put after end of session on management in each phpbb page.

(I've just put them on profile.php and search.php on Ajangkita.com.
The purpose of this post was to remind me only in case I need it in other time)

0 comments: