Code: Select all
//
// Start auth check
//
$is_auth = array();
$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_topic_data);
if( !$is_auth['auth_view'] || !$is_auth['auth_read'] )
{
if ( !$userdata['session_logged_in'] )
{
$redirect = ($post_id) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id";
$redirect .= ($start) ? "&start=$start" : '';
redirect(append_sid("login.$phpEx?redirect=viewtopic.$phpEx&$redirect", true));
}
$message = ( !$is_auth['auth_view'] ) ? $lang['Topic_post_not_exist'] : sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']);
message_die(GENERAL_MESSAGE, $message);
}
//
// End auth check
//