示例#1
0
        if ($APPLICATION->GetGroupRight("forum") < "W") {
            $arFilterAction["PERMISSION_STRONG"] = "Y";
        }
        $rsData = CForumTopic::GetListEx(array($by => $order), $arFilterAction);
        $arID = array();
        while ($res = $rsData->Fetch()) {
            $arID[] = $res['ID'];
        }
        if (empty($arID)) {
        } else {
            switch ($_REQUEST['action']) {
                case "delete":
                    ForumDeleteTopic($arID, $sError, $sOk);
                    break;
                case "move":
                    if (!CForumTopic::MoveTopic2Forum($arID, intVal($_REQUEST['move_to']))) {
                        $ex = $APPLICATION->GetException();
                        if ($ex && ($err = $ex->GetString())) {
                            $lAdmin->AddUpdateError($err, $ID);
                        } else {
                            $lAdmin->AddUpdateError(GetMessage("FM_WRONG_UPDATE"), $ID);
                        }
                    }
                    break;
            }
        }
    }
    if (!empty($sError)) {
        $lAdmin->AddFilterError($sError);
    }
}
示例#2
0
********************************************************************/
/********************************************************************
				Action
********************************************************************/
if (strToUpper($_REQUEST["action"]) == "MOVE" && check_bitrix_sessid()) {
    $strErrorMessage = "";
    $strOKMessage = "";
    $result = false;
    if (intVal($arParams["newFID"]) <= 0) {
        $strErrorMessage = GetMessage("FM_EMPTY_DEST_FORUM") . ". \n";
    } else {
        $arResult["FORUM_NEW"] = CForumNew::GetByID($arParams["newFID"]);
        if (ForumCurrUserPermissions($arParams["newFID"]) < "Q" && $arResult["FORUM_NEW"]["ALLOW_MOVE_TOPIC"] != "Y") {
            $strErrorMessage = GetMessage("FM_NO_DEST_FPERMS") . ". \n";
        } else {
            $result = CForumTopic::MoveTopic2Forum($topics, $arParams["newFID"], $_REQUEST["leaveLink"]);
        }
    }
    if (!$result) {
        if ($GLOBALS['APPLICATION']->GetException()) {
            $arErr = $GLOBALS['APPLICATION']->ERROR_STACK;
            if (is_array($arErr) && count($arErr) > 0) {
                foreach ($arErr as $res) {
                    $strErrorMessage .= $res["msg"] . "\n";
                }
            }
            $err = $GLOBALS['APPLICATION']->GetException();
            $strErrorMessage .= $err->GetString();
        }
        $bVarsFromForm = true;
    } else {
示例#3
0
 if (ForumCurrUserPermissions($FID) < "Q") {
     $APPLICATION->AuthForm(GetMessage("FM_NO_FPERMS"));
 }
 if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "move" && check_bitrix_sessid()) {
     if (IntVal($newFID) <= 0) {
         $strErrorMessage .= GetMessage("FM_EMPTY_DEST_FORUM") . ". \n";
     }
     if (strlen($strErrorMessage) <= 0) {
         $NewForum = CForumNew::GetByIDEx($newFID);
         if (ForumCurrUserPermissions($newFID) < "Q" && $NewForum["ALLOW_MOVE_TOPIC"] != "Y") {
             $strErrorMessage .= GetMessage("FM_NO_DEST_FPERMS") . ". \n";
         }
     }
     if (strlen($strErrorMessage) <= 0) {
         foreach ($arTopic as $Topic) {
             $res = CForumTopic::MoveTopic2Forum($Topic["ID"], $newFID);
             if (!$res) {
                 $strErrorMessage .= GetMessage("FM_ERR_MOVE_TOPIC") . ". \n";
             }
             //			elseif ($MakeNew)
             //			{
             //				foreach ($res as $MID)
             //				{
             //					CForumMessage::SendMailMessage($MID, array(), false, "NEW_FORUM_MESSAGE");
             //				}
             //			}
         }
     }
     if (strlen($strErrorMessage) > 0) {
         $bVarsFromForm = true;
     } else {