Beispiel #1
0
function lang_init()
{
    $available_languages = lang_get_available(false);
    if (isset($_SESSION['LANGUAGE']) && in_array($_SESSION['LANGUAGE'], $available_languages)) {
        $language = $_SESSION['LANGUAGE'];
    } else {
        if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
            $language = locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
        }
    }
    if (!isset($language)) {
        $language = forum_get_setting('default_language', 'strlen', 'en_GB');
    }
    $languages = array($language . '.utf8', $language . '.UTF8', $language . '.utf-8', $language . '.UTF-8', $language);
    setlocale(LC_ALL, $languages);
    putenv('LC_ALL=' . $language);
    putenv('LANG=' . $language);
    putenv('LANGUAGE=' . $language);
    bindtextdomain('messages', realpath(BH_INCLUDE_PATH . 'locale'));
    bind_textdomain_codeset('messages', 'UTF-8');
    textdomain('messages');
}
Beispiel #2
0
// End Required includes
// Where are we going after we've logged on?
if (isset($_GET['final_uri']) && strlen(trim($_GET['final_uri'])) > 0) {
    $available_files_preg = implode("|^", array_map('preg_quote_callback', get_light_mode_files()));
    if (preg_match("/^{$available_files_preg}/u", trim($_GET['final_uri'])) > 0) {
        $final_uri = href_cleanup_query_keys($_GET['final_uri']);
    }
}
// check to see if user registration is available
if (forum_get_setting('allow_new_registrations', 'N')) {
    light_html_draw_error(gettext("Sorry, new user registrations are not allowed right now. Please check back later."));
}
// Get an array of available emoticon sets
$available_emoticons = emoticons_get_available();
// Get an array of available languages
$available_langs = lang_get_available();
// Get an array of available timezones.
$available_timezones = get_available_timezones();
// Initialise the text captcha
$text_captcha = new captcha(6, 15, 25, 9, 30);
// Array to hold error messages
$error_msg_array = array();
$logon = null;
$nickname = null;
$email = null;
$private_key = null;
$password = null;
$check_password = null;
if (isset($_GET['private_key']) && strlen(trim($_GET['private_key'])) > 0) {
    $text_captcha_private_key = trim($_GET['private_key']);
} else {
// Perform additional admin login.
admin_check_credentials();
// Get the user's post page preferences.
$page_prefs = session::get_post_page_prefs();
// Content Ratings
$content_ratings_array = array(FORUM_RATING_GENERAL => 'General', FORUM_RATING_FOURTEEN => '14 Years', FORUM_RATING_MATURE => 'Mature', FORUM_RATING_RESTRICTED => 'Restricted');
// Array of valid Google Adsense ad user account types
$adsense_user_type_array = array(ADSENSE_DISPLAY_NONE => gettext("No-one (disabled)"), ADSENSE_DISPLAY_ALL_USERS => gettext("All Users"), ADSENSE_DISPLAY_GUESTS => gettext("Guests only"));
// Array of valid Google Adsense ad page types
$adsense_page_type_array = array(ADSENSE_DISPLAY_TOP_OF_ALL_PAGES => gettext("Top of every page"), ADSENSE_DISPLAY_TOP_OF_MESSAGES => gettext("Top of messages"), ADSENSE_DISPLAY_BOTTOM_OF_ALL_PAGES => gettext("Bottom of every page"), ADSENSE_DISPLAY_BOTTOM_OF_MESSAGES => gettext("Bottom of messages"), ADSENSE_DISPLAY_ONCE_AFTER_NTH_MSG => gettext("Once only after the nth post"), ADSENSE_DISPLAY_AFTER_EVERY_NTH_MSG => gettext("After every nth post"), ADSENSE_DISPLAY_AFTER_RANDOM_MSG => gettext("Once after a random post"));
// Array to hold error messages.
$error_msg_array = array();
// Get an array of available emoticon sets
$available_emoticons = emoticons_get_available();
// Get an array of available languages
$available_langs = lang_get_available(false);
// Get an array of available timezones.
$available_timezones = get_available_timezones();
// Get the forum settings
$forum_settings = forum_get_settings();
// Get the global forum settings
$forum_global_settings = forum_get_global_settings();
// Submit code starts here
if (isset($_POST['changepermissions'])) {
    $redirect_uri = "admin_forum_access.php?webtag={$webtag}&fid={$forum_settings['fid']}";
    $redirect_uri .= "&ret=" . rawurlencode(get_request_uri(true, false));
    header_redirect($redirect_uri);
    exit;
} else {
    if (isset($_POST['changepassword'])) {
        $redirect_uri = "admin_forum_set_passwd.php?webtag={$webtag}&fid={$forum_settings['fid']}";