当前位置: 首页>>代码示例>>PHP>>正文


PHP ForumCurrUserPermissions函数代码示例

本文整理汇总了PHP中ForumCurrUserPermissions函数的典型用法代码示例。如果您正苦于以下问题:PHP ForumCurrUserPermissions函数的具体用法?PHP ForumCurrUserPermissions怎么用?PHP ForumCurrUserPermissions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ForumCurrUserPermissions函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: str_replace

$cache_path_main = str_replace(array(":", "//"), "/", "/" . SITE_ID . "/" . $componentName . "/");
/********************************************************************
				/Default values
********************************************************************/
/********************************************************************
				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();
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例2: __forumIndexGetPermissions

 function __forumIndexGetPermissions(&$arRes, &$arNewMessage = null)
 {
     static $arNew = null;
     $result = false;
     if ($arNew === null && $arNewMessage !== null) {
         $arNew = $arNewMessage;
     }
     $arForums = array();
     if (isset($arRes['FORUMS']) && is_array($arRes['FORUMS'])) {
         $arForums =& $arRes['FORUMS'];
     } elseif (isset($arRes['FORUM']) && is_array($arRes['FORUM'])) {
         $arForums =& $arRes['FORUM'];
     }
     foreach ($arForums as &$res) {
         $res["PERMISSION"] = ForumCurrUserPermissions($res["ID"]);
         if ($res["PERMISSION"] >= "Q") {
             foreach (array("POSTER_ID", "POST_DATE", "POSTER_NAME", "MESSAGE_ID") as $key) {
                 $res["~LAST_" . $key] = $res["~ABS_LAST_" . $key];
                 $res["LAST_" . $key] = $res["ABS_LAST_" . $key];
             }
             $res["TID"] = $res["ABS_TID"];
             $res["TITLE"] = $res["ABS_TITLE"];
             $result = true;
         }
         $res["~NewMessage"] = isset($arNew[$res['ID']]) ? intval($arNew[$res['ID']]) : 0;
         $res["NewMessage"] = $res["~NewMessage"] > 0 ? "Y" : "N";
     }
     if (isset($arRes['GROUPS']) && is_array($arRes['GROUPS'])) {
         foreach ($arRes['GROUPS'] as &$res1) {
             $result = __forumIndexGetPermissions($res1) || $result;
         }
     }
     return $result;
 }
开发者ID:spas-viktor,项目名称:books,代码行数:34,代码来源:component.php

示例3: array

	}
	if ($arParams["CACHE_TIME"] > 0)
	{
		$cache->StartDataCache();
		CForumCacheManager::SetTag($cache_path_main, "forum_".$arParams["FORUM_ID"]);
		$cache->EndDataCache(array("arIblock" => $arIblock));
	}
}
$arResult["ELEMENT"] = $arIblock;
// FORUM
$arResult["FORUM"] = CForumNew::GetByIDEx($arParams["FORUM_ID"], SITE_ID);
// USER PERMISSION
$arResult["USER"] = array(
	"ID" => $USER->GetID(),
	"GROUPS" => $USER->GetUserGroupArray(),
	"PERMISSION" => ForumCurrUserPermissions($arParams["FORUM_ID"]),
	"SHOWED_NAME" => $GLOBALS["FORUM_STATUS_NAME"]["guest"],
	"SUBSCRIBE" => array(),
	"FORUM_SUBSCRIBE" => "N",
	"TOPIC_SUBSCRIBE" => "N");
/********************************************************************
				/Main Params
 ********************************************************************/

if (empty($arResult["FORUM"])):
	ShowError(str_replace("#FORUM_ID#", $arParams["FORUM_ID"], GetMessage("F_ERR_FID_IS_NOT_EXIST")));
	return false;
elseif (empty($arResult["ELEMENT"])):
	ShowError(str_replace("#ELEMENT_ID#", $arParams["ELEMENT_ID"], GetMessage("F_ERR_EID_IS_NOT_EXIST")));
	return false;
elseif ($arResult["USER"]["PERMISSION"] <= "A"):
开发者ID:akniyev,项目名称:arteva.ru,代码行数:31,代码来源:component.php

示例4: ShowError

if (empty($arResult["FORUM"])) {
    CHTTP::SetStatus("404 Not Found");
    ShowError(GetMessage("F_ERROR_FORUM_NOT_EXISTS"));
    return false;
} elseif (!CForumNew::CanUserViewForum($arParams["FID"], $USER->GetUserGroupArray())) {
    $APPLICATION->AuthForm(GetMessage("F_NO_FPERMS"));
    return false;
} elseif (!array_key_exists(SITE_ID, CForumNew::GetSites($arParams["FID"])) && ($arParams["SHOW_FORUM_ANOTHER_SITE"] == "N" || !CForumUser::IsAdmin())) {
    CHTTP::SetStatus("404 Not Found");
    ShowError(GetMessage("F_ERROR_FORUM_NOT_EXISTS"));
    return false;
}
/********************************************************************
				Default values
********************************************************************/
$arParams["PERMISSION"] = $arResult["PERMISSION"] = ForumCurrUserPermissions($arParams["FID"]);
$arResult["Topics"] = array();
$arResult["TOPICS"] = array();
$arResult["URL"] = array("INDEX" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_INDEX"], array()), "~INDEX" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_INDEX"], array()), "TOPIC_LIST" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_LIST"], array("FID" => $arParams["FID"])), "~TOPIC_LIST" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_LIST"], array("FID" => $arParams["FID"])), "TOPIC_NEW" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_TOPIC_NEW"], array("FID" => $arParams["FID"])), "~TOPIC_NEW" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_TOPIC_NEW"], array("FID" => $arParams["FID"])), "RSS" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_RSS"], array("TYPE" => "default", "MODE" => "forum", "IID" => $arParams["FID"])), "~RSS" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_RSS"], array("TYPE" => "default", "MODE" => "forum", "IID" => $arParams["FID"])), "RSS_DEFAULT" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_RSS"], array("TYPE" => "rss2", "MODE" => "forum", "IID" => $arParams["FID"])), "~RSS_DEFAULT" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_RSS"], array("TYPE" => "rss2", "MODE" => "forum", "IID" => $arParams["FID"])));
$arResult["CanUserAddTopic"] = CForumTopic::CanUserAddTopic($arParams["FID"], $USER->GetUserGroupArray(), $USER->GetID(), $arResult["FORUM"]);
$arResult["ERROR_MESSAGE"] = "";
$arResult["OK_MESSAGE"] = "";
$parser = new forumTextParser(false, false, false, "light");
$parser->MaxStringLen = $arParams["WORD_LENGTH"];
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    $arResult["TID"] = empty($_POST["TID_ARRAY"]) ? $_POST["TID"] : $_POST["TID_ARRAY"];
}
if (empty($arResult["TID"])) {
    $arResult["TID"] = empty($_REQUEST["TID_ARRAY"]) ? $_REQUEST["TID"] : $_REQUEST["TID_ARRAY"];
}
$ACTION = $_REQUEST["ACTION"];
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例5: array

    }
    $db_res = CIBlockElement::GetList(array(), $arFilter, false, false, array("IBLOCK_ID", "ID", "NAME", "TAGS", "CODE", "IBLOCK_SECTION_ID", "DETAIL_PAGE_URL", "CREATED_BY", "PREVIEW_PICTURE", "PREVIEW_TEXT", "PROPERTY_FORUM_TOPIC_ID", "PROPERTY_FORUM_MESSAGE_CNT"));
    if ($db_res && ($res = $db_res->GetNext())) {
        $arIblock = $res;
    }
    if ($arParams["CACHE_TIME"] > 0) {
        $cache->StartDataCache();
        CForumCacheManager::SetTag($cache_path_main, "forum_" . $arParams["FORUM_ID"]);
        $cache->EndDataCache(array("arIblock" => $arIblock));
    }
}
$arResult["ELEMENT"] = $arIblock;
// FORUM
$arResult["FORUM"] = CForumNew::GetByIDEx($arParams["FORUM_ID"], SITE_ID);
// USER PERMISSION
$arResult["USER"] = array("ID" => $USER->GetID(), "GROUPS" => $USER->GetUserGroupArray(), "PERMISSION" => ForumCurrUserPermissions($arParams["FORUM_ID"]), "SHOWED_NAME" => $GLOBALS["FORUM_STATUS_NAME"]["guest"], "SUBSCRIBE" => array(), "FORUM_SUBSCRIBE" => "N", "TOPIC_SUBSCRIBE" => "N");
/********************************************************************
				/Main Params
 ********************************************************************/
if (empty($arResult["FORUM"])) {
    ShowError(str_replace("#FORUM_ID#", $arParams["FORUM_ID"], GetMessage("F_ERR_FID_IS_NOT_EXIST")));
    return false;
} elseif (empty($arResult["ELEMENT"])) {
    ShowError(str_replace("#ELEMENT_ID#", $arParams["ELEMENT_ID"], GetMessage("F_ERR_EID_IS_NOT_EXIST")));
    return false;
} elseif ($arResult["USER"]["PERMISSION"] <= "A") {
    return false;
}
/********************************************************************
				Default values
 ********************************************************************/
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例6: elseif

                } elseif (CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_USER, $owner_id, "forum", "answer", $bIsCurrentUserModuleAdmin)) {
                    $arParams["PERMISSION"] = "I";
                } elseif (CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_USER, $owner_id, "forum", "view", $bIsCurrentUserModuleAdmin)) {
                    $arParams["PERMISSION"] = "E";
                }
            }
            $arParams["PERMISSION"] = $arParams["PERMISSION"] < $sPermission ? $sPermission : $arParams["PERMISSION"];
        }
    }
    if (empty($arResult["MESSAGE"])) {
        $arError = array("code" => "EMPTY MESSAGE", "title" => GetMessage("F_EMPTY_MID"));
    } elseif ($arParams["PERMISSION"]) {
        if ($arParams["PERMISSION"] < "E") {
            $arError = array("code" => "NOT RIGHT", "title" => GetMessage("F_NOT_RIGHT"));
        }
    } elseif (ForumCurrUserPermissions($arResult["MESSAGE"]["FORUM_ID"]) < "E") {
        $arError = array("code" => "NOT RIGHT", "title" => GetMessage("F_NOT_RIGHT"));
    }
}
if (!empty($arError)) {
    require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/prolog_after.php";
    echo ShowError(!empty($arError["title"]) ? $arError["title"] : $arError["code"]);
    require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog.php";
    die;
}
// *************************/Default params*************************************************************
set_time_limit(0);
if ($arParams["ACTION"] == "download") {
    CFile::ViewByUser($arResult["FILE"], array("force_download" => true));
} else {
    if (CFile::CheckImageFile(CFile::MakeFileArray($arResult["FILE"]["FILE_ID"])) === null && (file_exists($_SERVER["DOCUMENT_ROOT"] . $arResult["FILE"]["SRC"]) && CFile::GetImageSize($_SERVER["DOCUMENT_ROOT"] . $arResult["FILE"]["SRC"]) || $arResult["FILE"]["WIDTH"] > 0 && $arResult["FILE"]["HEIGHT"] > 0)) {
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:show_file.php

示例7: NewMessageForum

function NewMessageForum($FID, $LAST_POST_DATE = false)
{
    if (intVal($_SESSION["FORUM"]["LAST_VISIT_FORUM_0"]) <= 0) {
        ForumInitParams();
    }
    $FID = intVal($FID);
    $LAST_VISIT = max($_SESSION["FORUM"]["LAST_VISIT_FORUM_0"], $_SESSION["FORUM"]["LAST_VISIT_FORUM_" . $FID]);
    $LAST_POST_DATE = MakeTimeStamp($LAST_POST_DATE);
    if (intVal($LAST_POST_DATE) > 0 && $LAST_POST_DATE < $LAST_VISIT) {
        "";
    } elseif ($GLOBALS["USER"]->IsAuthorized()) {
        $arFilter = array("FORUM_ID" => $FID, "RENEW" => $GLOBALS["USER"]->GetID());
        if (ForumCurrUserPermissions($FID) < "Q") {
            $arFilter["APPROVED"] = "Y";
        }
        $db_res = CForumTopic::GetListEx(array("ID" => "DESC"), $arFilter, false, 1);
        if ($db_res && ($res = $db_res->Fetch())) {
            return true;
        }
    } else {
        $arFilter = array("FORUM_ID" => $FID);
        if (is_array($_SESSION["FORUM"]["GUEST_TID"]) && !empty($_SESSION["FORUM"]["GUEST_TID"])) {
            $arFilter["RENEW_TOPIC"][0] = ConvertTimeStamp($LAST_VISIT, "FULL");
            foreach ($_SESSION["FORUM"]["GUEST_TID"] as $key => $val) {
                $arFilter["RENEW_TOPIC"][intVal($key)] = ConvertTimeStamp($val, "FULL");
            }
        } else {
            $arFilter[">LAST_POST_DATE"] = ConvertTimeStamp($LAST_VISIT, "FULL");
        }
        if (ForumCurrUserPermissions($FID) < "Q") {
            $arFilter["APPROVED"] = "Y";
        }
        $db_res = CForumTopic::GetList(array(), $arFilter, false, 1);
        if ($db_res && ($res = $db_res->Fetch())) {
            return true;
        }
    }
    ForumInitParams();
    return false;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:40,代码来源:include.php

示例8: CDBResult

            continue;
        }
        $arrTOPICS[] = $arTopic;
    }
    $rsTopics = new CDBResult();
    $rsTopics->InitFromArray($arrTOPICS);
} else {
    $rsTopics = CForumTopic::GetListEx(array($by => $order, "POSTS" => "DESC"), $arFilter, false, 0, array("bDescPageNumbering" => false, "nPageSize" => $arParams["TOPICS_PER_PAGE"], "bShowAll" => false, "sNameTemplate" => $arParams["NAME_TEMPLATE"]));
}
$rsTopics->nPageWindow = $arParams["PAGE_NAVIGATION_WINDOW"];
$rsTopics->NavStart($arParams["TOPICS_PER_PAGE"], false);
$arResult["NAV_RESULT"] = $rsTopics;
$arResult["NAV_STRING"] = $rsTopics->GetPageNavStringEx($navComponentObject, GetMessage("FL_TOPIC_LIST"), $arParams["PAGE_NAVIGATION_TEMPLATE"]);
while ($res = $rsTopics->GetNext()) {
    if (!$USER->IsAuthorized()) {
        $res["PERMISSION"] = ForumCurrUserPermissions($res["FORUM_ID"]);
        //	elseif ($res["PERMISSION"] >= "Q"):
    }
    /*******************************************************************/
    $res["URL"] = array("TOPIC" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_READ"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "s")), "~TOPIC" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_READ"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "s")), "LAST_MESSAGE" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => intVal($res["LAST_MESSAGE_ID"]))), "~LAST_MESSAGE" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => intVal($res["LAST_MESSAGE_ID"]))), "MESSAGE_UNREAD" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "unread_mid")), "~MESSAGE_UNREAD" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_MESSAGE"], array("FID" => $res["FORUM_ID"], "TID" => $res["ID"], "TITLE_SEO" => $res["TITLE_SEO"], "MID" => "unread_mid")), "USER_START" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["USER_START_ID"])), "~USER_START" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["USER_START_ID"])), "LAST_POSTER" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["LAST_POSTER_ID"])), "~LAST_POSTER" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_PROFILE_VIEW"], array("UID" => $res["LAST_POSTER_ID"])));
    $res["TopicStatus"] = "NEW";
    /*******************************************************************/
    if ($res["PERMISSION"] >= "Q") {
        $res["LAST_POSTER_ID"] = $res["ABS_LAST_POSTER_ID"];
        $res["LAST_POST_DATE"] = $res["ABS_LAST_POST_DATE"];
        $res["LAST_POSTER_NAME"] = $res["ABS_LAST_POSTER_NAME"];
        $res["LAST_MESSAGE_ID"] = $res["ABS_LAST_MESSAGE_ID"];
        $res["mCnt"] = intVal($res["POSTS_UNAPPROVED"]);
        $res["numMessages"] = $res["POSTS"] + $res["mCnt"];
        $res["mCntURL"] = $res["URL"]["MODERATE_MESSAGE"];
    } else {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例9: elseif

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("forum")) {
    return false;
} elseif (!($_REQUEST["save_product_review"] == "Y" || in_array($_REQUEST['REVIEW_ACTION'], array('DEL', 'HIDE', 'SHOW')))) {
    return false;
} elseif (is_set($_REQUEST["ELEMENT_ID"]) && $arParams["ELEMENT_ID"] != $_REQUEST["ELEMENT_ID"]) {
    return false;
}
$this->IncludeComponentLang("action.php");
// 1.1. Check gross errors message data
if (!check_bitrix_sessid()) {
    $arError[] = array("code" => "session time is up", "title" => GetMessage("F_ERR_SESSION_TIME_IS_UP"));
} elseif (ForumCurrUserPermissions($arParams["FORUM_ID"]) <= "E") {
    $arError[] = array("code" => "access denied", "title" => GetMessage("F_ERR_NOT_RIGHT_FOR_ADD"));
} elseif ((empty($_REQUEST["preview_comment"]) || $_REQUEST["preview_comment"] == "N") && $_REQUEST["save_product_review"] == "Y") {
    $FORUM_TOPIC_ID = 0;
    $arProperties = array();
    $needProperty = array();
    $strErrorMessage = "";
    // 1.2 Check Post Text
    if (strLen($_REQUEST["REVIEW_TEXT"]) < 3) {
        $arError[] = array("code" => "post is empty", "title" => GetMessage("F_ERR_NO_REVIEW_TEXT"));
    } elseif (!$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")) {
                class CForumTmpCaptcha extends CCaptcha
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:30,代码来源:action.php

示例10: intval

/***************** STANDART ****************************************/
if ($arParams["CACHE_TYPE"] == "Y" || $arParams["CACHE_TYPE"] == "A" && COption::GetOptionString("main", "component_cache_on", "Y") == "Y") {
    $arParams["CACHE_TIME"] = intval($arParams["CACHE_TIME"]);
} else {
    $arParams["CACHE_TIME"] = 0;
}
$arParams["SET_TITLE"] = $arParams["SET_TITLE"] == "N" ? "N" : "Y";
/********************************************************************
				/Input params
********************************************************************/
/********************************************************************
				Default params # 1
********************************************************************/
$arResult["TOPIC"] = array();
$arResult["FORUM"] = CForumNew::GetByID($arParams["FID"]);
$arParams["PERMISSION_ORIGINAL"] = ForumCurrUserPermissions($arParams["FID"]);
$arParams["PERMISSION"] = "A";
$arError = array();
$arNote = array();
/********************************************************************
				/Default params #1
********************************************************************/
/********************************************************************
				Main Data & Permissions
********************************************************************/
$bCurrentUserIsAdmin = CSocNetUser::IsCurrentUserModuleAdmin();
if (empty($arResult["FORUM"])) {
    ShowError(GetMessage("F_FID_IS_LOST"));
    CHTTP::SetStatus("404 Not Found");
    return false;
} elseif ($arParams["MODE"] == "GROUP" && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "forum") || $arParams["MODE"] != "GROUP" && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_USER, $arParams["USER_ID"], "forum")) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例11: unset

unset($_GET["result"]);
unset($GLOBALS["HTTP_GET_VARS"]["result"]);
DeleteParam(array("result"));
$arResult["MESSAGES"] = array();
$arResult["MESSAGE_VIEW"] = array();
// FORUM
CPageOption::SetOptionString("main", "nav_page_in_session", "N");
$arResult['FORUM_TOPIC_ID'] = null;
$arResult["TOPIC"] = array();
$arFilter = array("FORUM_ID" => $arParams['FORUM_ID'], "XML_ID" => $arParams['ENTITY_XML_ID']);
$dbRes = CForumTopic::GetList(null, $arFilter);
if ($dbRes && ($arResult["TOPIC"] = $dbRes->Fetch())) {
    $arResult['FORUM_TOPIC_ID'] = $arResult["TOPIC"]['ID'];
}
$arResult["ELEMENT"] = array();
$arResult["USER"] = array("PERMISSION" => $arParams['PERMISSION'] !== null ? $arParams['PERMISSION'] : ForumCurrUserPermissions($arParams["FORUM_ID"]), "SHOWED_NAME" => $GLOBALS["FORUM_STATUS_NAME"]["guest"], "SUBSCRIBE" => array(), "FORUM_SUBSCRIBE" => "N", "TOPIC_SUBSCRIBE" => "N");
// A - NO ACCESS		E - READ			I - ANSWER
// M - NEW TOPIC		Q - MODERATE	U - EDIT			Y - FULL_ACCESS
$userId = $USER->GetID();
$arUserGroups = $USER->GetUserGroupArray();
if ($arResult["USER"]["PERMISSION"] !== null && !CForumUser::IsAdmin()) {
    $arResult["USER"]["RIGHTS"] = array("ADD_TOPIC" => $arParams['PERMISSION'] >= 'M' ? "Y" : "N", "MODERATE" => $arParams['PERMISSION'] >= 'Q' ? "Y" : "N", "EDIT" => $arParams['PERMISSION'] >= 'U' ? "Y" : "N", "ADD_MESSAGE" => $arParams['PERMISSION'] >= 'I' ? "Y" : "N");
} else {
    $arResult["USER"]["RIGHTS"] = array("ADD_TOPIC" => CForumTopic::CanUserAddTopic($arParams["FORUM_ID"], $arUserGroups, $userId, $arResult["FORUM"]) ? "Y" : "N", "MODERATE" => CForumNew::CanUserModerateForum($arParams["FORUM_ID"], $arUserGroups, $userId) == true ? "Y" : "N", "EDIT" => CForumNew::CanUserEditForum($arParams["FORUM_ID"], $arUserGroups, $userId) ? "Y" : "N", "ADD_MESSAGE" => CForumMessage::CanUserAddMessage($arResult['FORUM_TOPIC_ID'], $arUserGroups, $userId) ? "Y" : "N");
}
if ($USER->IsAuthorized()) {
    $arResult["USER"]["ID"] = $GLOBALS["USER"]->GetID();
    $tmpName = empty($arParams["NAME_TEMPLATE"]) ? $GLOBALS["USER"]->GetFormattedName(false) : CUser::FormatName($arParams["NAME_TEMPLATE"], array("NAME" => $USER->GetFirstName(), "LAST_NAME" => $USER->GetLastName(), "SECOND_NAME" => $USER->GetSecondName(), "LOGIN" => $USER->GetLogin()));
    $arResult["USER"]["SHOWED_NAME"] = trim($_SESSION["FORUM"]["SHOW_NAME"] == "Y" ? $tmpName : $GLOBALS["USER"]->GetLogin());
    $arResult["USER"]["SHOWED_NAME"] = trim(!empty($arResult["USER"]["SHOWED_NAME"]) ? $arResult["USER"]["SHOWED_NAME"] : $GLOBALS["USER"]->GetLogin());
}
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:component.php


注:本文中的ForumCurrUserPermissions函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。