$new_forum_settings['require_unique_email'] = "Y"; } else { $new_forum_settings['require_unique_email'] = "N"; } if (isset($_POST['require_email_confirmation']) && $_POST['require_email_confirmation'] == "Y") { $new_forum_settings['require_email_confirmation'] = "Y"; } else { $new_forum_settings['require_email_confirmation'] = "N"; } if (isset($_POST['forum_rules_enabled']) && $_POST['forum_rules_enabled'] == "Y") { $new_forum_settings['forum_rules_enabled'] = "Y"; } else { $new_forum_settings['forum_rules_enabled'] = "N"; } if (isset($_POST['forum_rules_message']) && strlen(trim($_POST['forum_rules_message'])) > 0) { $new_forum_settings['forum_rules_message'] = fix_html(emoticons_strip($_POST['forum_rules_message'])); } else { $new_forum_settings['forum_rules_message'] = ""; } if (isset($_POST['enable_google_analytics']) && $_POST['enable_google_analytics'] == "Y") { $new_forum_settings['enable_google_analytics'] = "Y"; } else { $new_forum_settings['enable_google_analytics'] = "N"; } if (isset($_POST['allow_forum_google_analytics']) && $_POST['allow_forum_google_analytics'] == "Y") { $new_forum_settings['allow_forum_google_analytics'] = "Y"; } else { $new_forum_settings['allow_forum_google_analytics'] = "N"; } if (isset($_POST['google_analytics_code']) && strlen(trim($_POST['google_analytics_code'])) > 0) { $new_forum_settings['google_analytics_code'] = trim($_POST['google_analytics_code']);
} } if (pm_edit_message($mid, $t_subject, $t_content)) { header_redirect("lpm.php?webtag={$webtag}&mid={$mid}"); exit; } else { $error_msg_array[] = gettext("Error creating PM! Please try again in a few minutes"); $valid = false; } } else { if (isset($_POST['emots_toggle'])) { if (isset($_POST['t_subject']) && strlen(trim($_POST['t_subject'])) > 0) { $t_subject = trim($_POST['t_subject']); } if (isset($_POST['t_content']) && strlen(trim($_POST['t_content'])) > 0) { $t_content = nl2br(fix_html(emoticons_strip($_POST['t_content']))); } if (isset($_POST['t_to_uid']) && is_numeric($_POST['t_to_uid'])) { $t_to_uid = $_POST['t_to_uid']; } else { $t_to_uid = 0; } $page_prefs = (double) $page_prefs ^ POST_EMOTICONS_DISPLAY; $user_prefs = array('POST_PAGE' => $page_prefs); if (!user_update_prefs($_SESSION['UID'], $user_prefs)) { $error_msg_array[] = gettext("Some or all of your user account details could not be updated. Please try again later."); $valid = false; } } else { if (!isset($message_data['EDITABLE']) || $message_data['EDITABLE'] == 0) { pm_edit_refuse();
$t_threadtitle = trim($_POST['t_threadtitle']); } if (isset($_POST['t_fid']) && is_numeric($_POST['t_fid'])) { if (folder_thread_type_allowed($_POST['t_fid'], FOLDER_ALLOW_NORMAL_THREAD)) { $t_fid = $_POST['t_fid']; } else { $error_msg_array[] = gettext("You cannot post this thread type in that folder!"); $valid = false; } } } if (isset($_POST['t_content']) && strlen(trim($_POST['t_content'])) > 0) { $t_content = fix_html(emoticons_strip($_POST['t_content'])); } if (isset($_POST['t_sig'])) { $t_sig = fix_html(emoticons_strip($_POST['t_sig'])); } if (isset($_POST['emots_toggle'])) { $page_prefs = (double) $page_prefs ^ POST_EMOTICONS_DISPLAY; } else { if (isset($_POST['sig_toggle'])) { $page_prefs = (double) $page_prefs ^ POST_SIGNATURE_DISPLAY; } } $user_prefs = array('POST_PAGE' => $page_prefs); if (!user_update_prefs($uid, $user_prefs)) { $error_msg_array[] = gettext("Some or all of your user account details could not be updated. Please try again later."); $valid = false; } } if (!isset($t_content)) {
$valid = false; } } } } else { if (!isset($question['OPTIONS_ARRAY']) || !is_array($question['OPTIONS_ARRAY'])) { $error_msg_array[] = gettext("You must provide at least 2 options for each question"); $valid = false; } else { foreach ($question['OPTIONS_ARRAY'] as $option_id => $option) { if (!isset($option['OPTION_NAME']) || strlen(trim($option['OPTION_NAME'])) == 0) { unset($question['OPTIONS_ARRAY'][$option_id]); } } if ($allow_html == true) { $question['QUESTION'] = fix_html(emoticons_strip($question['QUESTION'])); } else { $question['QUESTION'] = htmlentities_array($question['QUESTION']); } $poll_option_count += sizeof($question['OPTIONS_ARRAY']); if (sizeof($question['OPTIONS_ARRAY']) < 2) { $error_msg_array[] = gettext("You must provide at least 2 options for each question"); $valid = false; } else { foreach ($question['OPTIONS_ARRAY'] as $option_id => $option) { if ($allow_html == true) { $poll_questions_array[$question_id]['OPTIONS_ARRAY'][$option_id]['OPTION_NAME'] = fix_html($option['OPTION_NAME']); } else { $poll_questions_array[$question_id]['OPTIONS_ARRAY'][$option_id]['OPTION_NAME'] = htmlentities_array($option['OPTION_NAME']); } if (attachments_embed_check($option['OPTION_NAME']) && $allow_html == true) {
$sig_text = ""; } if (isset($_POST['sig_global']) && $_POST['sig_global'] == 'Y') { $t_sig_global = 'Y'; } else { $t_sig_global = 'N'; } if (session::check_perm(USER_PERM_ADMIN_TOOLS, 0) && $admin_edit === true) { $t_sig_global = 'N'; } if (attachments_embed_check($sig_text)) { $error_msg_array[] = gettext("You are not allowed to embed attachments in your signature."); $valid = false; } } $sig_text = fix_html(emoticons_strip($sig_text)); if (isset($_POST['save'])) { if ($valid) { // Update USER_SIG if (user_update_sig($sig_uid, $sig_text, $t_sig_global == 'Y')) { if ($admin_edit === true) { $redirect_uri = "admin_user.php?webtag={$webtag}&signature_updated=true&uid={$sig_uid}"; header_redirect($redirect_uri); } else { if ($t_sig_global == 'Y' && forums_get_available_count() > 1) { header_redirect("edit_signature.php?webtag={$webtag}&updated_global=true"); } else { header_redirect($redirect_uri = "edit_signature.php?webtag={$webtag}&updated=true"); } } }
} if (isset($_POST['access_level']) && is_numeric($_POST['access_level'])) { forum_update_access($forum_settings['fid'], $_POST['access_level']); } if (isset($_POST['closed_message']) && strlen(trim($_POST['closed_message'])) > 0) { $new_forum_settings['closed_message'] = fix_html(emoticons_strip($_POST['closed_message']), true); } else { $new_forum_settings['closed_message'] = ""; } if (isset($_POST['restricted_message']) && strlen(trim($_POST['restricted_message'])) > 0) { $new_forum_settings['restricted_message'] = fix_html(emoticons_strip($_POST['restricted_message']), true); } else { $new_forum_settings['restricted_message'] = ""; } if (isset($_POST['password_protected_message']) && strlen(trim($_POST['password_protected_message'])) > 0) { $new_forum_settings['password_protected_message'] = fix_html(emoticons_strip($_POST['password_protected_message']), true); } else { $new_forum_settings['password_protected_message'] = ""; } if (isset($_POST['allow_post_editing']) && $_POST['allow_post_editing'] == "Y") { $new_forum_settings['allow_post_editing'] = "Y"; } else { $new_forum_settings['allow_post_editing'] = "N"; } if (isset($_POST['post_edit_time']) && is_numeric($_POST['post_edit_time'])) { $new_forum_settings['post_edit_time'] = $_POST['post_edit_time']; } else { $new_forum_settings['post_edit_time'] = 0; } if (isset($_POST['post_edit_grace_period']) && is_numeric($_POST['post_edit_grace_period'])) { $new_forum_settings['post_edit_grace_period'] = $_POST['post_edit_grace_period'];
} else { $error_msg_array[] = gettext("Date of birth is required or is invalid"); $valid = false; } if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) > 0) { $new_user_prefs['FIRSTNAME'] = trim($_POST['firstname']); } else { $new_user_prefs['FIRSTNAME'] = ""; } if (isset($_POST['lastname']) && strlen(trim($_POST['lastname'])) > 0) { $new_user_prefs['LASTNAME'] = trim($_POST['lastname']); } else { $new_user_prefs['LASTNAME'] = ""; } if (isset($_POST['sig_content']) && strlen(trim($_POST['sig_content'])) > 0) { $sig_content = fix_html(emoticons_strip(trim($_POST['sig_content']))); } else { $sig_content = ""; } if (isset($_POST['email_notify']) && $_POST['email_notify'] == "Y") { $new_user_prefs['EMAIL_NOTIFY'] = "Y"; } else { $new_user_prefs['EMAIL_NOTIFY'] = "N"; } if (isset($_POST['pm_notify_email']) && $_POST['pm_notify_email'] == "Y") { $new_user_prefs['PM_NOTIFY_EMAIL'] = "Y"; } else { $new_user_prefs['PM_NOTIFY_EMAIL'] = "N"; } if (isset($_POST['pm_notify']) && $_POST['pm_notify'] == "Y") { $new_user_prefs['PM_NOTIFY'] = "Y";
$page_prefs = (double) $page_prefs ^ POST_EMOTICONS_DISPLAY; $user_prefs = array('POST_PAGE' => $page_prefs); if (!user_update_prefs($_SESSION['UID'], $user_prefs)) { $error_msg_array[] = gettext("Some or all of your user account details could not be updated. Please try again later."); $valid = false; } } if (isset($_POST['send']) || isset($_POST['preview']) || isset($_POST['save'])) { if (isset($_POST['subject']) && strlen(trim($_POST['subject'])) > 0) { $subject = trim($_POST['subject']); } else { $error_msg_array[] = gettext("Enter a subject for the message"); $valid = false; } if (isset($_POST['content']) && strlen(trim($_POST['content'])) > 0) { $content = fix_html(emoticons_strip($_POST['content'])); } else { $error_msg_array[] = gettext("Enter some content for the message"); $valid = false; } if (isset($reply_mid) && is_numeric($reply_mid) && $reply_mid > 0) { if (($pm_data = pm_message_get($reply_mid)) !== false) { $pm_data['CONTENT'] = pm_get_content($reply_mid); } else { html_draw_top(array('title' => gettext("Error"))); pm_error_refuse(); html_draw_bottom(); exit; } } if (isset($_POST['to_logon']) && strlen(trim($_POST['to_logon'])) > 0) {
if (!session::logged_in()) { html_guest_error(); } // Check we have Admin / Moderator access if (!session::check_perm(USER_PERM_ADMIN_TOOLS, 0)) { html_draw_error(gettext("You do not have permission to use this section.")); } // Perform additional admin login. admin_check_credentials(); // Get the user's post page preferences. $page_prefs = session::get_post_page_prefs(); // Array to hold error messages $error_msg_array = array(); // Check to see if we're submitting new page or retrieving the old one. if (isset($_POST['t_content']) && strlen(trim($_POST['t_content'])) > 0) { $t_content = fix_html(emoticons_strip($_POST['t_content']), true); } else { $t_content = forum_get_setting('start_page', 'strlen', ''); } // Submit code. if (isset($_POST['save'])) { // New array of forum settings. $new_forum_settings = array('start_page' => $t_content); // Save the settings. if (forum_save_settings($new_forum_settings)) { // Update the admin log. admin_add_log_entry(EDITED_START_PAGE); // Redirect back to self. header_redirect("admin_startpage.php?webtag={$webtag}&updated=true"); exit; }