function html_guest_error() { $frame_top_target = html_get_top_frame_name(); $webtag = get_webtag(); forum_check_webtag_available($webtag); $final_uri = sprintf("logon.php?webtag=%s&final_uri=%s", $webtag, rawurlencode(get_request_uri(true, false))); $available_popup_files_preg = implode("|^", array_map('preg_quote_callback', get_available_popup_files())); $available_support_pages_preg = implode("|^", array_map('preg_quote_callback', get_available_support_files())); if (preg_match("/^{$available_popup_files_preg}/", $final_uri) > 0) { html_draw_error(gettext("Sorry, you need to be logged in to use this feature."), null, 'post', array('close_popup' => gettext("Close"))); } else { if (preg_match("/^{$available_support_pages_preg}/", $final_uri) > 0) { html_draw_error(gettext("Sorry, you need to be logged in to use this feature.")); } else { html_draw_error(gettext("Sorry, you need to be logged in to use this feature."), html_get_forum_file_path('logout.php'), 'post', array('submit' => gettext("Login now"), 'register' => gettext("Register")), array('final_uri' => $final_uri), $frame_top_target); } } }
function forum_restricted_message() { cache_disable(); $final_uri = basename(get_request_uri()); $available_popup_files_preg = implode("|^", array_map('preg_quote_callback', get_available_popup_files())); if (preg_match("/^{$available_popup_files_preg}/", $final_uri) > 0) { $forum_owner_link_target = "_blank"; } else { $forum_owner_link_target = html_get_top_frame_name(); } if (($restricted_message = forum_get_setting('restricted_message', null, false)) !== false) { html_draw_error(fix_html($restricted_message), '600', 'center'); } else { $forum_name = forum_get_setting('forum_name', null, 'A Beehive Forum'); if (!($forum_owner_uid = forum_get_setting('owner_uid'))) { html_draw_error(sprintf(gettext("You do not have access to %s"), htmlentities_array($forum_name))); } $webtag = get_webtag(); forum_check_webtag_available($webtag); $forum_owner_pm_link = sprintf('pm_write.php?webtag=%s&uid=%s', $webtag, $forum_owner_uid); $forum_owner_link = sprintf('<a href="index.php?webtag=%s&final_uri=%s" target="%s">%s</a>', $webtag, rawurlencode($forum_owner_pm_link), $forum_owner_link_target, gettext('Forum Owner')); $apply_for_access_text = sprintf(gettext("To apply for access please contact the %s."), $forum_owner_link); html_draw_error(sprintf(gettext("You do not have access to %s. To apply for access please contact the %s"), htmlentities_array($forum_name), $apply_for_access_text)); } }