示例#1
0
}
$this->IncludeComponentLang("action.php");
// Check gross errors message data
$APPLICATION->RestartBuffer();
/** @var $request \Bitrix\Main\HttpRequest */
$request = \Bitrix\Main\Context::getCurrent()->getRequest();
$post = array_merge($request->getQueryList()->toArray(), $request->getPostList()->toArray());
if ($post["AJAX_POST"] == "Y") {
    CUtil::decodeURIComponent($post);
}
if (!check_bitrix_sessid()) {
    $arError[] = array("code" => "session time is up", "title" => GetMessage("F_ERR_SESSION_TIME_IS_UP"));
} elseif ($arResult["USER"]['PERMISSION'] <= "E") {
    $arError[] = array("code" => "access denied", "title" => GetMessage("F_ERR_NOT_RIGHT_FOR_ADD"));
} elseif ($post['REVIEW_ACTION'] == "EDIT" || $post['REVIEW_ACTION'] == "DEL") {
    $arResult["MESSAGE"] = CForumMessage::GetById($post["MID"]);
    if ($arResult["MESSAGE"]["TOPIC_ID"] != $arResult["TOPIC"]["ID"] || $arResult["USER"]["RIGHTS"]["EDIT"] !== "Y" && ($arResult["MESSAGE"]["AUTHOR_ID"] <= 0 || $arResult["MESSAGE"]["AUTHOR_ID"] != $GLOBALS["USER"]->GetID() || $arParams["ALLOW_EDIT_OWN_MESSAGE"] == "LAST" && $arResult["MESSAGE"]["ID"] != $arResult["TOPIC"]["ABS_LAST_MESSAGE_ID"])) {
        $arError[] = array("code" => "access denied", "title" => GetMessage("F_ERR_NOT_RIGHT_FOR_EDIT"));
    }
}
if (!empty($arError)) {
} elseif ((empty($_REQUEST["preview_comment"]) || $_REQUEST["preview_comment"] == "N") && $_REQUEST["comment_review"] == "Y") {
    $arProperties = array();
    $needProperty = array();
    $strErrorMessage = "";
    // Check Captcha
    if (!$GLOBALS["USER"]->IsAuthorized() && ($arParams["USE_CAPTCHA"] == "Y" || $arResult["FORUM"]["USE_CAPTCHA"] == "Y")) {
        include_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/captcha.php";
        $captchaPass = COption::GetOptionString("main", "captcha_password", "");
        if ($arResult["FORUM"]["USE_CAPTCHA"] == "Y") {
            if (!class_exists("CForumTmpCaptcha")) {