Example #1
0
            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();
            }
            $parsed_message = new MessageTextParse(pm_get_content($mid));
            $t_content = $parsed_message->getMessage();
            $t_subject = $message_data['SUBJECT'];
        }
    }
}
light_html_draw_top(array('title' => gettext('Edit Message'), 'js' => array('js/fineuploader.min.js')));
light_navigation_bar(array('back' => "lpm.php?webtag={$webtag}&mid={$mid}"));
if ($valid && isset($_POST['preview'])) {
    echo "<h3>", gettext("Message Preview"), "</h3>\n";
    light_pm_display($message_data, true);
}
echo "<form accept-charset=\"utf-8\" name=\"f_post\" action=\"lpm_edit.php\" method=\"post\" target=\"_self\">\n";
echo "  ", form_csrf_token_field(), "\n";
echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
echo "  ", form_input_hidden('mid', htmlentities_array($mid)), "\n";
echo "<div class=\"post\">\n";
echo "<h3>", gettext("Edit Message"), "</h3>\n";
echo "<div class=\"post_inner\">\n";
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    light_html_display_error_array($error_msg_array);
}
echo "<div class=\"post_thread_title\">", gettext("Subject"), ":", light_form_input_text("t_subject", isset($t_subject) ? htmlentities_array($t_subject) : "", 30, 64), "</div>\n";
Example #2
0
    light_html_draw_error(gettext("You cannot create new threads."));
}
if (isset($thread_data['CLOSED']) && $thread_data['CLOSED'] > 0 && !session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
    light_html_draw_error(gettext("This thread is closed, you cannot post in it!"));
}
if (isset($return_msg)) {
    $back = "lmessages.php?webtag={$webtag}&msg={$return_msg}";
} else {
    if (isset($tid) && is_numeric($tid) && isset($reply_to_pid) && is_numeric($reply_to_pid)) {
        $back = "lmessages.php?webtag={$webtag}&msg={$tid}.{$reply_to_pid}";
    } else {
        $back = "lthread_list.php?webtag={$webtag}";
    }
}
light_html_draw_top(array('title' => gettext('Post message'), 'js' => array('js/fineuploader.min.js', 'js/attachments.js')));
light_navigation_bar(array('back' => $back));
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    light_html_display_error_array($error_msg_array);
}
if (!$new_thread && isset($thread_data['CLOSED']) && $thread_data['CLOSED'] > 0 && session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
    light_html_display_warning_msg(gettext("Warning: this thread is closed for posting to normal users."));
}
if ($valid && isset($_POST['preview'])) {
    echo "<h3>", gettext("Message Preview"), "</h3>";
    $preview_message['RECIPIENTS'] = $to_logon_array;
    $preview_fuser = user_get($_SESSION['UID']);
    $preview_message['FROM_LOGON'] = $preview_fuser['LOGON'];
    $preview_message['FROM_NICKNAME'] = $preview_fuser['NICKNAME'];
    $preview_message['FROM_UID'] = $preview_fuser['UID'];
    $preview_message['CONTENT'] = $content;
    if ($allow_sig == true && strlen(trim($sig)) > 0) {
Example #3
0
                }
            } else {
                light_html_draw_top(array('title' => gettext("User Registration")));
                light_navigation_bar();
                light_html_display_msg(gettext("Successfully created user account"), gettext("Your user account has been created successfully! Click the continue button below to login"), 'index.php', 'get', array('continue' => gettext("Continue")), array('final_uri' => $final_uri));
                light_html_draw_bottom();
                exit;
            }
        } else {
            $error_msg_array[] = gettext("Error creating user record");
            $valid = false;
        }
    }
}
light_html_draw_top(array('title' => gettext('User Registration'), 'js' => array('js/register.js')));
light_navigation_bar();
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    light_html_display_error_array($error_msg_array);
}
echo "<form accept-charset=\"utf-8\" name=\"form_register\" action=\"", get_request_uri(), "\" method=\"post\" target=\"_self\">\n";
echo "  ", form_csrf_token_field(), "\n";
echo "<div class=\"register\">\n";
echo "<h3>", gettext("Register"), "</h3>\n";
echo "<div class=\"register_inner\">\n";
if (isset($user_agree_rules) && $user_agree_rules == 'Y') {
    echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
    echo "  ", form_input_hidden('user_agree_rules', htmlentities_array($user_agree_rules)), "\n";
    echo "  <div class=\"register_username\"><span>", gettext("Username"), ":</span>", light_form_input_text("user_logon", null, 20, 15) . "</div>\n";
    echo "  <div class=\"register_password\"><span>", gettext("Password"), ":</span>", light_form_input_password("user_password", null, 20, 32), "</div>\n";
    echo "  <div class=\"register_password\"><span>", gettext("Confirm Password"), ":</span>", light_form_input_password("user_password", null, 20, 32), "</div>\n";
    echo "  <div class=\"register_nickname\"><span>", gettext("Nickname"), ":</span>", light_form_input_text("nickname", null, 20, 32), "</div>\n";
Example #4
0
function light_html_draw_error($message, $href = null, $method = 'get', array $buttons = array(), array $vars = array())
{
    light_html_draw_top();
    light_navigation_bar();
    light_html_display_msg(gettext('Error'), $message, $href, $method, $buttons, $vars);
    light_html_draw_bottom();
    exit;
}
Example #5
0
                    } else {
                        if ($_REQUEST['mark_read_type'] == THREAD_MARK_READ_FOLDER && (isset($folder) && is_numeric($folder))) {
                            if (threads_mark_folder_read($folder)) {
                                header_redirect("lthread_list.php?webtag={$webtag}&mode={$mode}&folder={$folder}&mark_read_success=true");
                                exit;
                            } else {
                                $error_msg_array[] = gettext("Failed to mark selected threads as read");
                                $valid = false;
                            }
                        }
                    }
                }
            }
        } else {
            unset($_REQUEST['mark_read_submit'], $_REQUEST['mark_read_confirm']);
            light_html_draw_top();
            light_navigation_bar();
            light_html_display_msg(gettext("Confirm"), gettext("Are you sure you want to mark the selected threads as read?"), 'lthread_list.php', 'post', array('mark_read_submit' => gettext("Confirm"), 'cancel' => gettext("Cancel")), array_merge($_REQUEST, array('mark_read_confirm' => 'Y')));
            light_html_draw_bottom();
            exit;
        }
    }
}
light_html_draw_top(array('js' => array('js/thread_list.js')));
if (forums_get_available_count() > 1 || !forum_get_default()) {
    light_navigation_bar(array('back' => "lforums.php?webtag={$webtag}", 'nav_links' => array(array('text' => gettext('New Discussion'), 'url' => "lpost.php?webtag={$webtag}", 'class' => 'post_new', 'image' => 'mobile_post'))));
} else {
    light_navigation_bar(array('nav_links' => array(array('text' => gettext('New Discussion'), 'url' => "lpost.php?webtag={$webtag}", 'class' => 'post_new', 'image' => 'mobile_post'))));
}
light_draw_thread_list($mode, $folder, $page);
light_html_draw_bottom();
Example #6
0
                    }
                    $parsed_message = new MessageTextParse($edit_message['CONTENT']);
                    $content = $parsed_message->getMessage();
                    $sig = $parsed_message->getSig();
                } else {
                    light_html_draw_error(sprintf(gettext("Message %s was not found"), $msg), 'lthread_list.php', 'get', array('back' => gettext("Back")));
                }
            } else {
                light_html_draw_error(sprintf(gettext("Message %s was not found"), $msg), 'lthread_list.php', 'get', array('back' => gettext("Back")));
            }
        }
    }
}
$page_title = sprintf(gettext("Edit message %s"), $msg);
light_html_draw_top(array('title' => $page_title, 'js' => array('js/fineuploader.min.js', 'js/attachments.js')));
light_navigation_bar(array('back' => "lmessages.php?webtag={$webtag}&msg={$return_msg}"));
if ($valid && isset($_POST['preview'])) {
    echo "<h3>", gettext("Message Preview"), "</h3>";
    light_message_display($tid, $edit_message, $thread_data['LENGTH'], $pid, $thread_data['FID'], false, false, false, false, true);
}
echo "<form accept-charset=\"utf-8\" name=\"f_edit\" action=\"ledit.php\" method=\"post\" target=\"_self\">\n";
echo "  ", form_csrf_token_field(), "\n";
echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
echo form_input_hidden("msg", htmlentities_array($msg));
echo form_input_hidden('return_msg', htmlentities_array($return_msg)), "\n";
echo "<div class=\"post\">\n";
echo "<h3>", $page_title, "</h3>\n";
echo "<div class=\"post_inner\">\n";
echo "<div class=\"post_to\">", gettext("To"), ":\n";
echo "<div class=\"recipients\">\n";
if (isset($edit_message['RECIPIENTS']) && sizeof($edit_message['RECIPIENTS']) > 0) {
Example #7
0
require_once BH_INCLUDE_PATH . 'constants.inc.php';
require_once BH_INCLUDE_PATH . 'html.inc.php';
require_once BH_INCLUDE_PATH . 'light.inc.php';
require_once BH_INCLUDE_PATH . 'pm.inc.php';
require_once BH_INCLUDE_PATH . 'session.inc.php';
// End Required includes
// Check we're logged in correctly
if (!session::logged_in()) {
    light_html_guest_error();
}
if (isset($_GET['mid']) && is_numeric($_GET['mid'])) {
    $mid = $_GET['mid'] > 0 ? $_GET['mid'] : 0;
} else {
    if (isset($_POST['mid']) && is_numeric($_POST['mid'])) {
        $mid = $_POST['mid'] > 0 ? $_POST['mid'] : 0;
    } else {
        $mid = null;
    }
}
// Check that PM system is enabled
light_pm_enabled();
// Prune old messages for the current user
pm_user_prune_folders($_SESSION['UID']);
light_html_draw_top(array('js' => array('js/pm.js')));
if (isset($mid) && is_numeric($mid)) {
    light_navigation_bar(array('back' => "lpm.php?webtag={$webtag}"));
} else {
    light_navigation_bar(array('nav_links' => array(array('text' => gettext('Send New PM'), 'url' => "lpm_write.php?webtag={$webtag}", 'class' => 'pm_send_new', 'image' => 'mobile_post'))));
}
light_draw_pm_inbox();
light_html_draw_bottom();
Example #8
0
    if (isset($_POST['poll_change_vote'])) {
        poll_delete_vote($tid);
        header_redirect("lmessages.php?webtag={$webtag}&msg={$msg}");
    }
}
if (!($folder_data = thread_get_folder($tid))) {
    light_html_display_error_msg(gettext("The requested folder could not be found or access was denied."));
    return;
}
$perm_folder_moderate = session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_data['FID']);
if (!($thread_data = thread_get($tid, $perm_folder_moderate, false, $perm_folder_moderate))) {
    light_html_display_error_msg(gettext("The requested thread could not be found or access was denied."));
    return;
}
if (isset($_SESSION['POSTS_PER_PAGE']) && is_numeric($_SESSION['POSTS_PER_PAGE'])) {
    $posts_per_page = max(min($_SESSION['POSTS_PER_PAGE'], 30), 10);
} else {
    $posts_per_page = 20;
}
if (!($messages = messages_get($tid, $pid, $posts_per_page))) {
    light_html_display_error_msg(gettext("That post does not exist in this thread!"));
    return;
}
light_html_draw_top(array('js' => array('js/messages.js')));
$nav_links = array(array('text' => gettext('Show messages'), 'url' => '#', 'class' => 'navigation', 'html' => light_messages_navigation_strip($tid, $pid, $thread_data['LENGTH'], 10), 'image' => 'mobile_navigation'));
if (!$thread_data['CLOSED'] && session::check_perm(USER_PERM_POST_CREATE, $folder_data['FID'])) {
    array_unshift($nav_links, array('text' => gettext('Reply to All'), 'url' => "lpost.php?webtag={$webtag}&reply_to={$tid}.0&return_msg={$tid}.{$pid}", 'class' => 'reply_all', 'image' => 'mobile_reply_all'));
}
light_navigation_bar(array('back' => "lthread_list.php?webtag={$webtag}", 'nav_links' => $nav_links));
light_draw_messages($tid, $pid, $thread_data, $messages);
light_html_draw_bottom();