本文整理汇总了PHP中CSocNetFeaturesPerms::SetPerm方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetFeaturesPerms::SetPerm方法的具体用法?PHP CSocNetFeaturesPerms::SetPerm怎么用?PHP CSocNetFeaturesPerms::SetPerm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetFeaturesPerms
的用法示例。
在下文中一共展示了CSocNetFeaturesPerms::SetPerm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMessage
if (!$errorMessage && $USER->IsAuthorized() && $arResult["PERMISSION"] > "R") {
if ($_SERVER['REQUEST_METHOD'] == 'POST' && array_key_exists("sm_action", $_REQUEST) && strlen($_REQUEST["sm_action"]) > 0 && strlen($_REQUEST["feature"]) > 0 && !in_array($_REQUEST["feature"], $arStaticTabs)) {
if (!array_key_exists($_REQUEST["feature"], $arSocNetFeaturesSettings)) {
$errorMessage = GetMessage("SONET_SM_FEATURE_INCORRECT");
} elseif (!in_array($arParams["ENTITY_TYPE"], $arSocNetFeaturesSettings[$_REQUEST["feature"]]["allowed"])) {
$errorMessage = GetMessage("SONET_SM_FEATURE_INACTIVE");
}
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && array_key_exists("sm_action", $_REQUEST) && $_REQUEST["sm_action"] == "update" && strlen($_REQUEST["feature"]) > 0 && check_bitrix_sessid()) {
if (!$errorMessage) {
CUtil::JSPostUnescape();
$idTmp = CSocNetFeatures::SetFeature($arParams["ENTITY_TYPE"], $arParams["ENTITY_ID"], $_REQUEST["feature"], true, StrLen($_REQUEST[$_REQUEST["feature"] . "_name"]) > 0 ? $_REQUEST[$_REQUEST["feature"] . "_name"] : false);
if ($idTmp && (!array_key_exists("hide_operations_settings", $arSocNetFeaturesSettings[$_REQUEST["feature"]]) || !$arSocNetFeaturesSettings[$_REQUEST["feature"]]["hide_operations_settings"])) {
foreach ($arSocNetFeaturesSettings[$_REQUEST["feature"]]["operations"] as $operation => $perm) {
if (!array_key_exists("restricted", $arSocNetFeaturesSettings[$_REQUEST["feature"]]["operations"][$operation]) || !in_array($key, $arSocNetFeaturesSettings[$_REQUEST["feature"]]["operations"][$operation]["restricted"][$arParams["ENTITY_TYPE"]])) {
$id1Tmp = CSocNetFeaturesPerms::SetPerm($idTmp, $operation, $_REQUEST[$_REQUEST["feature"] . "_" . $operation . "_perm"]);
if (!$id1Tmp && ($e = $APPLICATION->GetException())) {
$errorMessage .= $e->GetString();
}
}
}
} elseif ($e = $APPLICATION->GetException()) {
$errorMessage = $e->GetString();
}
}
$APPLICATION->RestartBuffer();
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/interface/admin_lib.php';
$obJSPopup = new CJSPopup();
if (!$errorMessage) {
$obJSPopup->Close();
} else {