本文整理汇总了PHP中CIBlockRights类的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockRights类的具体用法?PHP CIBlockRights怎么用?PHP CIBlockRights使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CIBlockRights类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: canRead
public function canRead($userId)
{
if (!Loader::includeModule("iblock")) {
return false;
}
$iblockId = $this->entityId;
return \CIBlockRights::userHasRightTo($iblockId, $iblockId, "element_read") || \CIBlockSectionRights::userHasRightTo($iblockId, 0, "section_element_bind");
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:iblockworkflowconnector.php
示例2: CheckIBlockOperation
public static function CheckIBlockOperation($intIBlockID, $strOperation, $strAccess)
{
$intIBlockID = intval($intIBlockID);
if ($intIBlockID <= 0) {
return false;
}
if (!self::$boolCheck) {
self::CheckExtRights();
}
if (self::$boolExtRights) {
return CIBlockRights::UserHasRightTo($intIBlockID, $intIBlockID, $strOperation);
} else {
return CIBlock::GetPermission($intIBlockID) >= $strAccess;
}
}
开发者ID:Hawkart,项目名称:megatv,代码行数:15,代码来源:iblock_rights.php
示例3: executeComponent
public function executeComponent()
{
global $USER, $APPLICATION;
$this->setFrameMode(false);
if (!CModule::IncludeModule('lists')) {
ShowError(Loc::getMessage("CC_BLL_MODULE_NOT_INSTALLED"));
return;
}
$this->arResult["BIZPROC"] = (bool) CModule::includeModule("bizproc");
$this->arResult["DISK"] = (bool) CModule::includeModule("disk");
$this->listsPerm = CListPermissions::CheckAccess($USER, $this->arParams["~IBLOCK_TYPE_ID"], $this->arResult["IBLOCK_ID"], $this->arParams["~SOCNET_GROUP_ID"]);
if ($this->listsPerm < 0) {
switch ($this->listsPerm) {
case CListPermissions::WRONG_IBLOCK_TYPE:
ShowError(GetMessage("CC_BLL_WRONG_IBLOCK_TYPE"));
return;
case CListPermissions::WRONG_IBLOCK:
ShowError(GetMessage("CC_BLL_WRONG_IBLOCK"));
return;
case CListPermissions::LISTS_FOR_SONET_GROUP_DISABLED:
ShowError(GetMessage("CC_BLL_LISTS_FOR_SONET_GROUP_DISABLED"));
return;
default:
ShowError(GetMessage("CC_BLL_UNKNOWN_ERROR"));
return;
}
} elseif ($this->listsPerm < CListPermissions::CAN_READ && !(CIBlockRights::UserHasRightTo($this->arResult["IBLOCK_ID"], $this->arResult["IBLOCK_ID"], "element_read") || CIBlockSectionRights::UserHasRightTo($this->arResult["IBLOCK_ID"], $this->arResult["SECTION_ID"], "section_element_bind"))) {
ShowError(GetMessage("CC_BLL_ACCESS_DENIED"));
return;
}
if (!(!$this->arResult["IS_SOCNET_GROUP_CLOSED"] && ($this->listsPerm > CListPermissions::CAN_READ || CIBlockSectionRights::UserHasRightTo($this->arResult["IBLOCK_ID"], $this->arResult["SECTION_ID"], "element_read") || CIBlockSectionRights::UserHasRightTo($this->arResult["IBLOCK_ID"], $this->arResult["SECTION_ID"], "section_element_bind")))) {
ShowError(GetMessage("CC_BLL_ACCESS_DENIED"));
return;
}
$this->createDataExcel();
$APPLICATION->RestartBuffer();
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: filename=list_" . $this->arIBlock["ID"] . ".xls");
$this->IncludeComponentTemplate();
$r = $APPLICATION->EndBufferContentMan();
echo $r;
include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";
die;
}
开发者ID:webgksupport,项目名称:alpina,代码行数:44,代码来源:class.php
示例4: checkPermission
protected function checkPermission()
{
global $USER;
$this->listPerm = CListPermissions::checkAccess($USER, $this->iblockTypeId, $this->iblockId, $this->socnetGroupId);
if ($this->listPerm < 0) {
switch ($this->listPerm) {
case CListPermissions::WRONG_IBLOCK_TYPE:
$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_WRONG_IBLOCK_TYPE'))));
break;
case CListPermissions::WRONG_IBLOCK:
$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_WRONG_IBLOCK'))));
break;
case CListPermissions::LISTS_FOR_SONET_GROUP_DISABLED:
$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_SONET_GROUP_DISABLED'))));
break;
default:
$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_UNKNOWN_ERROR'))));
break;
}
} elseif ($this->listPerm < CListPermissions::CAN_READ && !(CIBlockRights::userHasRightTo($this->iblockId, $this->iblockId, "element_read") || CIBlockSectionRights::userHasRightTo($this->iblockId, $this->sectionId, "section_element_bind"))) {
$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_ACCESS_DENIED'))));
}
}
开发者ID:webgksupport,项目名称:alpina,代码行数:23,代码来源:ajax.php
示例5: GetAllowableUserGroups
/**
* @param $documentType
* @param bool $withExtended
* @return array|bool
*/
public function GetAllowableUserGroups($documentType, $withExtended = false)
{
$documentType = trim($documentType);
if (strlen($documentType) <= 0) {
return false;
}
$iblockId = intval(substr($documentType, strlen("iblock_")));
$result = array("Author" => GetMessage("IBD_DOCUMENT_AUTHOR"));
$groupsId = array(1);
$extendedGroupsCode = array();
if (CIBlock::getArrayByID($iblockId, "RIGHTS_MODE") === "E") {
$rights = new CIBlockRights($iblockId);
foreach ($rights->getGroups() as $iblockGroupCode) {
if (preg_match("/^G(\\d+)\$/", $iblockGroupCode, $match)) {
$groupsId[] = $match[1];
} else {
$extendedGroupsCode[] = $iblockGroupCode;
}
}
} else {
foreach (CIBlock::getGroupPermissions($iblockId) as $groupId => $perm) {
if ($perm > "R") {
$groupsId[] = $groupId;
}
}
}
$groupsIterator = CGroup::getListEx(array("NAME" => "ASC"), array("ID" => $groupsId));
while ($group = $groupsIterator->fetch()) {
$result[$group["ID"]] = $group["NAME"];
}
if ($withExtended && $extendedGroupsCode) {
foreach ($extendedGroupsCode as $groupCode) {
$result['group_' . $groupCode] = CBPHelper::getExtendedGroupName($groupCode);
}
}
return $result;
}
开发者ID:Satariall,项目名称:izurit,代码行数:42,代码来源:bizprocdocument.php
示例6: elseif
$intIBlockID = false;
if (isset($_REQUEST["PARAMS"]['IBLOCK_ID'])) {
$intIBlockID = (int) $_REQUEST["PARAMS"]['IBLOCK_ID'];
} elseif (isset($_REQUEST["IBLOCK_ID"])) {
$intIBlockID = (int) $_REQUEST["IBLOCK_ID"];
}
if ($intIBlockID < 0 || $intIBlockID === false) {
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
ShowError(GetMessage("BT_ADM_IEP_IBLOCK_ID_IS_INVALID"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
die;
} elseif ($intIBlockID > 0) {
$rsIBlocks = CIBlock::GetList(array(), array("ID" => $intIBlockID, "CHECK_PERMISSIONS" => "N"));
$arIBlock = $rsIBlocks->Fetch();
if ($arIBlock) {
if (!CIBlockRights::UserHasRightTo($intIBlockID, $intIBlockID, "iblock_edit")) {
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
die;
}
} else {
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
ShowError(str_replace('#ID#', $intIBlockID, GetMessage("BT_ADM_IEP_IBLOCK_NOT_EXISTS")));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
die;
}
}
if (isset($_REQUEST["PARAMS"]['ID'])) {
$str_PROPERTY_ID = htmlspecialcharsbx($_REQUEST["PARAMS"]['ID']);
} elseif (isset($_REQUEST['ID'])) {
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:iblock_edit_property.php
示例7: array
die;
}
$boolOffers = false;
$arOffers = false;
$arOfferIBlock = false;
$intOfferIBlockID = 0;
$arSelectOfferProps = array();
$arSelectedPropTypes = array('S', 'N', 'L', 'E', 'G');
$arOffersSelectKeys = array(YANDEX_SKU_EXPORT_ALL, YANDEX_SKU_EXPORT_MIN_PRICE, YANDEX_SKU_EXPORT_PROP);
$arOffers = CCatalogSKU::GetInfoByProductIBlock($intIBlockID);
if (!empty($arOffers['IBLOCK_ID'])) {
$intOfferIBlockID = $arOffers['IBLOCK_ID'];
$strPerm = 'D';
$rsOfferIBlocks = CIBlock::GetByID($intOfferIBlockID);
if ($arOfferIBlock = $rsOfferIBlocks->Fetch()) {
$bBadBlock = !CIBlockRights::UserHasRightTo($intOfferIBlockID, $intOfferIBlockID, "iblock_admin_display");
if ($bBadBlock) {
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
echo ShowError(GetMessage('YANDEX_ERR_NO_ACCESS_IBLOCK_SKU'));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
die;
}
} else {
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
echo ShowError(str_replace('#ID#', $intIBlockID, GetMessage("YANDEX_ERR_NO_IBLOCK_SKU_FOUND")));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
die;
}
$boolOffers = true;
}
$arCondSelectProp = array('ZERO' => GetMessage('YANDEX_SKU_EXPORT_PROP_SELECT_ZERO'), 'NONZERO' => GetMessage('YANDEX_SKU_EXPORT_PROP_SELECT_NONZERO'), 'EQUAL' => GetMessage('YANDEX_SKU_EXPORT_PROP_SELECT_EQUAL'), 'NONEQUAL' => GetMessage('YANDEX_SKU_EXPORT_PROP_SELECT_NONEQUAL'));
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:yandex_detail.php
示例8: define
die;
}
if (preg_match('/^[a-z0-9_]{2}$/i', $_REQUEST['site'])) {
define('SITE_ID', $_REQUEST['site']);
}
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
Loc::loadMessages(__FILE__);
global $APPLICATION;
if (!CModule::IncludeModule('iblock')) {
echo Loc::getMessage("BT_COMP_MLI_AJAX_ERR_MODULE_ABSENT");
die;
}
CUtil::JSPostUnescape();
$IBlockID = intval($_REQUEST["IBLOCK_ID"]);
if (!CIBlockRights::UserHasRightTo($IBlockID, $IBlockID, "iblock_admin_display")) {
echo Loc::getMessage('BT_COMP_MLI_AJAX_ERR_IBLOCK_ACCESS_DENIED');
die;
}
$arIBlock = CIBlock::GetArrayByID($IBlockID);
$strBanSym = trim($_REQUEST['BAN_SYM']);
$arBanSym = str_split($strBanSym, 1);
$strRepSym = trim($_REQUEST['REP_SYM']);
$arRepSym = array_fill(0, sizeof($arBanSym), $strRepSym);
$bSection = false;
if (isset($_REQUEST['TYPE']) && 'SECTION' == $_REQUEST['TYPE']) {
$bSection = true;
}
if ($_REQUEST['MODE'] == 'SEARCH') {
$APPLICATION->RestartBuffer();
$arResult = array();
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:ajax.php
示例9: intval
CUtil::JSPostUnescape();
$iblock_id = intval($_REQUEST["IBLOCK_ID"]);
$lists_perm = CListPermissions::CheckAccess($USER, $_REQUEST["IBLOCK_TYPE_ID"], $iblock_id, $_REQUEST["SOCNET_GROUP_ID"]);
if ($lists_perm < 0) {
switch ($lists_perm) {
case CListPermissions::WRONG_IBLOCK_TYPE:
ShowError(GetMessage("CT_BMTS_WRONG_IBLOCK_TYPE"));
die;
case CListPermissions::WRONG_IBLOCK:
ShowError(GetMessage("CT_BMTS_WRONG_IBLOCK"));
die;
default:
ShowError(GetMessage("CT_BMTS_UNKNOWN_ERROR"));
die;
}
} elseif ($lists_perm < CListPermissions::CAN_READ && !CIBlockRights::UserHasRightTo($iblock_id, $iblock_id, "element_read")) {
ShowError(GetMessage("CT_BMTS_ACCESS_DENIED"));
die;
}
$arIBlock = CIBlock::GetArrayByID($iblock_id);
if ($_REQUEST['MODE'] == 'section') {
$arResult = array();
$SECTION_ID = intval($_REQUEST['SECTION_ID']);
//if($SECTION_ID == 0)
// $SECTION_ID = false;
$rsElements = CIBlockElement::GetList(array('ID' => 'ASC'), array('IBLOCK_ID' => $arIBlock["ID"], 'SECTION_ID' => $SECTION_ID, 'CHECK_PERMISSIONS' => $arParams['CAN_EDIT'] ? 'N' : 'Y'), false, false, array("ID", "NAME", "IBLOCK_SECTION_ID"));
while ($arElement = $rsElements->Fetch()) {
$arResult[] = array("ID" => $arElement["ID"], "NAME" => $arElement["NAME"], "SECTION_ID" => $arElement["IBLOCK_SECTION_ID"], "CONTENT" => '<div class="mts-name">' . htmlspecialcharsex($arElement["NAME"]) . '</div>');
}
$APPLICATION->RestartBuffer();
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:ajax.php
示例10: GetAllowableUserGroups
public function GetAllowableUserGroups($documentType)
{
$documentType = trim($documentType);
if (strlen($documentType) <= 0) {
return false;
}
$iblockId = intval(substr($documentType, strlen("iblock_")));
$arResult = array("Author" => GetMessage("IBD_DOCUMENT_AUTHOR"));
$arRes = array(1);
if (CIBlock::GetArrayByID($iblockId, "RIGHTS_MODE") === "E") {
$obRights = new CIBlockRights($iblockId);
foreach ($obRights->GetGroups() as $GROUP_CODE) {
if (preg_match("/^G(\\d+)\$/", $GROUP_CODE, $match)) {
$arRes[] = $match[1];
}
}
} else {
foreach (CIBlock::GetGroupPermissions($iblockId) as $groupId => $perm) {
if ($perm > "R") {
$arRes[] = $groupId;
}
}
}
$dbGroupsList = CGroup::GetListEx(array("NAME" => "ASC"), array("ID" => $arRes));
while ($arGroup = $dbGroupsList->Fetch()) {
$arResult[$arGroup["ID"]] = $arGroup["NAME"];
}
return $arResult;
}
开发者ID:spas-viktor,项目名称:books,代码行数:29,代码来源:iblockdocument.php
示例11: unset
if (preg_match("/^G(\\d)\$/", $arRight["GROUP_CODE"], $match) && is_array($arListsPerm) && in_array($match[1], $arListsPerm)) {
unset($arResult["RIGHTS"][$RIGHT_ID]);
$arResult["SELECTED"][$arRight["GROUP_CODE"]] = true;
} else {
//2) protect groups with iblock_% operations
$arOperations = CTask::GetOperations($arRight['TASK_ID'], true);
foreach ($arOperations as $operation) {
if (preg_match("/^iblock_(?!admin)/", $operation)) {
unset($arResult["RIGHTS"][$RIGHT_ID]);
$arResult["SELECTED"][$arRight["GROUP_CODE"]] = true;
break;
}
}
}
}
$arResult["TASKS"] = CIBlockRights::GetRightsList();
foreach ($arResult["TASKS"] as $TASK_ID => $label) {
//2) protect tasks with iblock_% operations
$arOperations = CTask::GetOperations($TASK_ID, true);
foreach ($arOperations as $operation) {
if (preg_match("/^iblock_(?!admin)/", $operation)) {
unset($arResult["TASKS"][$TASK_ID]);
break;
}
}
}
}
$arResult["VARS_FROM_FORM"] = $bVarsFromForm;
$arResult["FORM_DATA"] = array();
foreach ($data as $key => $value) {
$arResult["FORM_DATA"]["~" . $key] = $value;
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php
示例12: array
BX.WindowManager.Get().Close();
if(window.reloadAfterClose)
top.BX.reload(true);
}
}";
$tabControl->ButtonsPublic(array(
'.btnSave',
($ID > 0 && $bWorkflow? $wfClose: $cancel),
$save_and_add,
));
endif;
$tabControl->Show();
if (
(!defined('BX_PUBLIC_MODE') || BX_PUBLIC_MODE != 1)
&& CIBlockRights::UserHasRightTo($IBLOCK_ID, $IBLOCK_ID, "iblock_edit")
&& !$bAutocomplete
)
{
echo
BeginNote(),
GetMessage("IBEL_E_IBLOCK_MANAGE_HINT"),
' <a href="/bitrix/admin/iblock_edit.php?type='.htmlspecialcharsbx($type).'&lang='.LANGUAGE_ID.'&ID='.$IBLOCK_ID.'&admin=Y&return_url='.urlencode("/bitrix/admin/".CIBlock::GetAdminElementEditLink($IBLOCK_ID, $ID, array("WF" => ($WF=="Y"? "Y": null), "find_section_section" => intval($find_section_section), "return_url" => (strlen($return_url)>0? $return_url: null)))).'">',
GetMessage("IBEL_E_IBLOCK_MANAGE_HINT_HREF"),
'</a>',
EndNote()
;
}
//////////////////////////
//END of the custom form
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:iblock_element_edit.php
示例13: ReSort
public static function ReSort($IBLOCK_ID, $ID = 0, $cnt = 0, $depth = 0, $ACTIVE = "Y")
{
$cnt = self::TreeReSort($IBLOCK_ID, $ID, $cnt, $depth, $ACTIVE);
$obIBlockRights = new CIBlockRights($IBLOCK_ID);
$obIBlockRights->Recalculate();
return $cnt;
}
开发者ID:rasuldev,项目名称:torino,代码行数:7,代码来源:iblocksection.php
示例14: GetMessage
if (is_array($arCatalog))
{
$arPropLinks = CIBlockSectionPropertyLink::GetArray($arCatalog["IBLOCK_ID"], 0);
?>
<tr colspan="2" class="heading">
<td align="center"><?echo GetMessage("CAT_CEDIT_PROP_SKU_SECTION");?></td>
</tr>
<tr colspan="2"><td align="center">
<table class="internal" id="table_SKU_SECTION_PROPERTY">
<tr class="heading">
<td><?echo GetMessage("CAT_CEDIT_PROP_TABLE_NAME");?></td>
<td><?echo GetMessage("CAT_CEDIT_PROP_TABLE_TYPE");?></td>
<td><?echo GetMessage("CAT_CEDIT_PROP_TABLE_SMART_FILTER");?></td>
<td><?echo GetMessage("CAT_CEDIT_PROP_TABLE_ACTION");?></td></tr>
<?
if(CIBlockRights::UserHasRightTo($arCatalog["IBLOCK_ID"], $arCatalog["IBLOCK_ID"], "iblock_edit"))
$arShadow = $arHidden = array(
-1 => GetMessage("CAT_CEDIT_PROP_SELECT_CHOOSE"),
0 => GetMessage("CAT_CEDIT_PROP_SELECT_CREATE"),
);
else
$arShadow = $arHidden = array(
-1 => GetMessage("CAT_CEDIT_PROP_SELECT_CHOOSE"),
);
$rsProps = CIBlockProperty::GetList(array(
"SORT"=>"ASC",
'ID' => 'ASC',
), array(
"IBLOCK_ID" => $arCatalog["IBLOCK_ID"],
"CHECK_PERMISSIONS" => "N",
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:cat_catalog_edit.php
示例15: IncludeModuleLangFile
<?php
/** @global CMain $APPLICATION */
/** @global CDatabase $DB */
use Bitrix\Main\Loader, Bitrix\Main, Bitrix\Iblock;
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
Loader::includeModule('iblock');
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/iblock/prolog.php";
IncludeModuleLangFile(__FILE__);
$arIBlock = CIBlock::GetArrayByID($_GET["IBLOCK_ID"]);
if (!is_array($arIBlock)) {
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
if (!CIBlockRights::UserHasRightTo($arIBlock["ID"], $arIBlock["ID"], "iblock_edit")) {
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
$simpleTypeList = array(Iblock\PropertyTable::TYPE_STRING => true, Iblock\PropertyTable::TYPE_NUMBER => true, Iblock\PropertyTable::TYPE_LIST => true, Iblock\PropertyTable::TYPE_FILE => true, Iblock\PropertyTable::TYPE_SECTION => true, Iblock\PropertyTable::TYPE_ELEMENT => true);
$sTableID = "tbl_iblock_property_admin_" . $arIBlock["ID"];
$oSort = new CAdminSorting($sTableID, 'SORT', 'ASC');
$lAdmin = new CAdminList($sTableID, $oSort);
$arFilterFields = array("find_name", "find_code", "find_active", "find_searchable", "find_filtrable", "find_is_required", "find_multiple", "find_xml_id", "find_property_type");
$lAdmin->InitFilter($arFilterFields);
$arFilter = array("=IBLOCK_ID" => $arIBlock["ID"], "?NAME" => $find_name, "?CODE" => $find_code, "=ACTIVE" => $find_active, "=SEARCHABLE" => $find_searchable, "=FILTRABLE" => $find_filtrable, "=XML_ID" => $find_xml_id, "=PROPERTY_TYPE" => $find_property_type, "=IS_REQUIRED" => $find_is_required, "=MULTIPLE" => $find_multiple);
foreach ($arFilter as $key => $value) {
if (!strlen(trim($value))) {
unset($arFilter[$key]);
}
}
if (isset($arFilter['=PROPERTY_TYPE'])) {
if (!isset($simpleTypeList[$arFilter['=PROPERTY_TYPE']])) {
list($arFilter['=PROPERTY_TYPE'], $arFilter['=USER_TYPE']) = explode(':', $arFilter['=PROPERTY_TYPE'], 2);
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:iblock_property_admin.php
示例16: ShowError
return;
case CListPermissions::WRONG_IBLOCK:
ShowError(GetMessage("CC_BLL_WRONG_IBLOCK"));
return;
case CListPermissions::LISTS_FOR_SONET_GROUP_DISABLED:
ShowError(GetMessage("CC_BLL_LISTS_FOR_SONET_GROUP_DISABLED"));
return;
default:
ShowError(GetMessage("CC_BLL_UNKNOWN_ERROR"));
return;
}
} elseif ($lists_perm < CListPermissions::CAN_READ && !(CIBlockRights::UserHasRightTo($IBLOCK_ID, $IBLOCK_ID, "element_read") || CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $section_id, "section_element_bind"))) {
ShowError(GetMessage("CC_BLL_ACCESS_DENIED"));
return;
}
$arParams["CAN_EDIT"] = !$arResult["IS_SOCNET_GROUP_CLOSED"] && ($lists_perm >= CListPermissions::IS_ADMIN || CIBlockRights::UserHasRightTo($IBLOCK_ID, $IBLOCK_ID, "iblock_edit"));
$arResult["CAN_ADD_ELEMENT"] = !$arResult["IS_SOCNET_GROUP_CLOSED"] && ($lists_perm > CListPermissions::CAN_READ || CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $section_id, "section_element_bind"));
$arResult["CAN_READ"] = !$arResult["IS_SOCNET_GROUP_CLOSED"] && ($lists_perm > CListPermissions::CAN_READ || CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $section_id, "element_read"));
$arResult["CAN_EDIT_SECTIONS"] = !$arResult["IS_SOCNET_GROUP_CLOSED"] && ($lists_perm >= CListPermissions::CAN_WRITE || CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $section_id, "section_edit") || CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $section_id, "section_section_bind"));
$arResult["IBLOCK_PERM"] = $lists_perm;
$arResult["USER_GROUPS"] = $USER->GetUserGroupArray();
$arIBlock = CIBlock::GetArrayByID(intval($arParams["~IBLOCK_ID"]));
$arResult["~IBLOCK"] = $arIBlock;
$arResult["IBLOCK"] = htmlspecialcharsex($arIBlock);
$arResult["IBLOCK_ID"] = $arIBlock["ID"];
$arResult["PROCESSES"] = false;
$arResult["USE_COMMENTS"] = false;
$arResult["RAND_STRING"] = $this->randString();
if ($arParams["IBLOCK_TYPE_ID"] == COption::GetOptionString("lists", "livefeed_iblock_type_id")) {
$arResult["USE_COMMENTS"] = (bool) CModule::includeModule("forum");
$arResult["PROCESSES"] = true;
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php
示例17: Delete
/**
* <p>Функция удаляет информационный блок.</p>
*
*
*
*
* @param int $ID Код информационного блока.
*
*
*
* @return bool <a href="http://dev.1c-bitrix.ru/api_help/iblock/events/onbeforeiblockdelete.php">OnBeforeIBlockDelete</a><a
* name="examples"></a>
*
*
* <h4>Example</h4>
* <pre>
* <?<br>if($USER->IsAdmin())<br>{<br> $DB->StartTransaction();<br> if(!CIBlock::Delete($iblock_id))<br> {<br> $strWarning .= GetMessage("IBLOCK_DELETE_ERROR");<br> $DB->Rollback();<br> }<br> else<br> $DB->Commit();<br>}<br>?><br>
* </pre>
*
*
* @static
* @link http://dev.1c-bitrix.ru/api_help/iblock/classes/ciblock/delete.php
* @author Bitrix
*/
public static function Delete($ID)
{
$err_mess = "FILE: " . __FILE__ . "<br>LINE: ";
/** @global CDatabase $DB */
global $DB;
/** @global CMain $APPLICATION */
global $APPLICATION;
/** @global CUserTypeManager $USER_FIELD_MANAGER */
global $USER_FIELD_MANAGER;
/** @global CCacheManager $CACHE_MANAGER */
global $CACHE_MANAGER;
$ID = IntVal($ID);
$APPLICATION->ResetException();
foreach (GetModuleEvents("iblock", "OnBeforeIBlockDelete", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID)) === false) {
$err = GetMessage("MAIN_BEFORE_DEL_ERR") . ' ' . $arEvent['TO_NAME'];
$ex = $APPLICATION->GetException();
if (is_object($ex)) {
$err .= ': ' . $ex->GetString();
}
$APPLICATION->throwException($err);
return false;
}
}
foreach (GetModuleEvents("iblock", "OnIBlockDelete", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID));
}
$iblockSections = CIBlockSection::GetList(array(), array("IBLOCK_ID" => $ID, "DEPTH_LEVEL" => 1, "CHECK_PERMISSIONS" => "N"), false, array("ID"));
while ($iblockSection = $iblockSections->Fetch()) {
if (!CIBlockSection::Delete($iblockSection["ID"], false)) {
return false;
}
}
$iblockElements = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $ID, "SHOW_NEW" => "Y", "CHECK_PERMISSIONS" => "N"), false, false, array("IBLOCK_ID", "ID"));
while ($iblockElement = $iblockElements->Fetch()) {
if (!CIBlockElement::Delete($iblockElement["ID"])) {
return false;
}
}
$props = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $ID, "CHECK_PERMISSIONS" => "N"));
while ($property = $props->Fetch()) {
if (!CIBlockProperty::Delete($property["ID"])) {
return false;
}
}
$seq = new CIBlockSequence($ID);
$seq->Drop(true);
$obIBlockRights = new CIBlockRights($ID);
$obIBlockRights->DeleteAllRights();
CIBlockSectionPropertyLink::DeleteByIBlock($ID);
$DB->Query("delete from b_iblock_offers_tmp where PRODUCT_IBLOCK_ID=" . $ID, false, $err_mess . __LINE__);
$DB->Query("delete from b_iblock_offers_tmp where OFFERS_IBLOCK_ID=" . $ID, false, $err_mess . __LINE__);
if (!$DB->Query("DELETE FROM b_iblock_messages WHERE IBLOCK_ID = " . $ID, false, $err_mess . __LINE__)) {
return false;
}
if (!$DB->Query("DELETE FROM b_iblock_fields WHERE IBLOCK_ID = " . $ID, false, $err_mess . __LINE__)) {
return false;
}
$USER_FIELD_MANAGER->OnEntityDelete("IBLOCK_" . $ID . "_SECTION");
if (!$DB->Query("DELETE FROM b_iblock_group WHERE IBLOCK_ID=" . $ID, false, $err_mess . __LINE__)) {
return false;
}
if (!$DB->Query("DELETE FROM b_iblock_rss WHERE IBLOCK_ID=" . $ID, false, $err_mess . __LINE__)) {
return false;
}
if (!$DB->Query("DELETE FROM b_iblock_site WHERE IBLOCK_ID=" . $ID, false, $err_mess . __LINE__)) {
return false;
}
if (!$DB->Query("DELETE FROM b_iblock WHERE ID=" . $ID, false, $err_mess . __LINE__)) {
return false;
}
$DB->Query("DROP TABLE b_iblock_element_prop_s" . $ID, true, $err_mess . __LINE__);
$DB->Query("DROP TABLE b_iblock_element_prop_m" . $ID, true, $err_mess . __LINE__);
$DB->Query("DROP SEQUENCE sq_b_iblock_element_prop_m" . $ID, true, $err_mess . __LINE__);
CIBlock::CleanCache($ID);
if (defined("BX_COMP_MANAGED_CACHE")) {
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:101,代码来源:iblock.php
示例18: checkIblockAccess
protected function checkIblockAccess()
{
if (!$this->checkPermissions) {
return true;
}
$id = $this->getIblockId();
$error = '';
if ($id) {
if (!\CIBlockRights::UserHasRightTo($id, $id, "element_read")) {
$error = Loc::getMessage("SPS_NO_PERMS");
}
} else {
$error = Loc::getMessage("SPS_NO_CATALOGS");
}
if ($error) {
$this->arResult['ERROR'] = $error;
$this->arResult['IS_EXTERNALCONTEXT'] = $this->isExternalContext();
$this->includeComponentTemplate('error');
exit;
}
}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:21,代码来源:class.php
示例19: GetMessage
}
$oFilter->Buttons();
?><input class="adm-btn" type="submit" name="set_filter" value="<? echo GetMessage("admin_lib_filter_set_butt"); ?>" title="<? echo GetMessage("admin_lib_filter_set_butt_title"); ?>" onClick="return applyFilter(this);">
<input class="adm-btn" type="submit" name="del_filter" value="<? echo GetMessage("admin_lib_filter_clear_butt"); ?>" title="<? echo GetMessage("admin_lib_filter_clear_butt_title"); ?>" onClick="deleteFilter(this); return false;">
<?
$oFilter->End();
?>
</form>
<?
$lAdmin->DisplayList();
if($bWorkFlow || $bBizproc):
echo BeginNote();?>
<span class="adm-lamp adm-lamp-green"></span> - <?echo GetMessage("IBLIST_A_GREEN_ALT")?></br>
<span class="adm-lamp adm-lamp-yellow"></span> - <?echo GetMessage("IBLIST_A_YELLOW_ALT")?></br>
<span class="adm-lamp adm-lamp-red"></span> - <?echo GetMessage("IBLIST_A_RED_ALT")?></br>
<?echo EndNote();
endif;
if(CIBlockRights::UserHasRightTo($IBLOCK_ID, $IBLOCK_ID, "iblock_edit") && !defined("CATALOG_PRODUCT"))
{
echo
BeginNote(),
GetMessage("IBLIST_A_IBLOCK_MANAGE_HINT"),
' <a href="'.htmlspecialcharsbx('iblock_edit.php?type='.urlencode($type).'&lang='.LANGUAGE_ID.'&ID='.$IBLOCK_ID.'&admin=Y&return_url='.urlencode("iblock_list_admin.php?".$sThisSectionUrl)).'">',
GetMessage("IBLIST_A_IBLOCK_MANAGE_HINT_HREF"),
'</a>',
EndNote()
;
}
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_admin.php");
?>
开发者ID:nycmic,项目名称:bittest,代码行数:31,代码来源:iblock_list_admin.php
示例20: array
if (!Is_Array($arParams["USERGROUPS_MODIFY"])) {
if (IntVal($arParams["USERGROUPS_MODIFY"]) > 0) {
$arParams["USERGROUPS_MODIFY"] = array($arParams["USERGROUPS_MODIFY"]);
} else {
$arParams["USERGROUPS_MODIFY"] = array();
}
}
if (!Is_Array($arParams["USERGROUPS_RESERVE"])) {
if (IntVal($arParams["USERGROUPS_RESERVE"]) > 0) {
$arParams["USERGROUPS_RESERVE"] = array($arParams["USERGROUPS_RESERVE"]);
} else {
$arParams["USERGROUPS_RESERVE"] = array();
}
}
$arResult["FatalError"] = "";
if (!CIBlockRights::UserHasRightTo($iblockId, $iblockId, 'element_read')) {
$arResult["FatalError"] .= GetMessage("INTS_NO_IBLOCK_PERMS") . ".";
}
if (StrLen($arResult["FatalError"]) <= 0) {
$deleteMeetingId = IntVal($_REQUEST["delete_meeting_id"]);
if ($deleteMeetingId > 0 && check_bitrix_sessid() && $GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || Count(Array_Intersect($GLOBALS["USER"]->GetUserGroupArray(), $arParams["USERGROUPS_MODIFY"])) > 0)) {
$dbMeetingsList = CIBlockSection::GetList(array(), array("IBLOCK_ID" => $iblockId, "ID" => $deleteMeetingId));
if ($arMeeting = $dbMeetingsList->Fetch()) {
CIBlockSection::Delete($arMeeting["ID"]);
}
}
}
$arResult["ALLOWED_FIELDS"] = array("ID" => array("NAME" => GetMessage("INAF_F_ID"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "int", "IS_FIELD" => true), "NAME" => array("NAME" => GetMessage("INAF_F_NAME"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "string", "IS_FIELD" => true), "DESCRIPTION" => array("NAME" => GetMessage("INAF_F_DESCRIPTION"), "ORDERABLE" => false, "FILTERABLE" => false, "TYPE" => "text", "IS_FIELD" => true), "UF_FLOOR" => array("NAME" => GetMessage("INAF_F_FLOOR"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "integer", "IS_FIELD" => false), "UF_PLACE" => array("NAME" => GetMessage("INAF_F_PLACE"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "integer", "IS_FIELD" => false), "UF_PHONE" => array("NAME" => GetMessage("INAF_F_PHONE"), "ORDERABLE" => false, "FILTERABLE" => false, "TYPE" => "string", "IS_FIELD" => false));
$arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("IBLOCK_" . $iblockId . "_SECTION", 0, LANGUAGE_ID);
$arKeys = Array_Keys($arResult["ALLOWED_FIELDS"]);
foreach ($arKeys as $key) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php
注:本文中的CIBlockRights类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论