本文整理汇总了PHP中CCrmSecurityHelper::IsAuthorized方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmSecurityHelper::IsAuthorized方法的具体用法?PHP CCrmSecurityHelper::IsAuthorized怎么用?PHP CCrmSecurityHelper::IsAuthorized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmSecurityHelper
的用法示例。
在下文中一共展示了CCrmSecurityHelper::IsAuthorized方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
<?php
define('NO_KEEP_STATISTIC', 'Y');
define('NO_AGENT_STATISTIC', 'Y');
define('NO_AGENT_CHECK', true);
define('PUBLIC_AJAX_MODE', true);
define('DisableEventsCheck', true);
$siteID = isset($_REQUEST['site']) ? substr(preg_replace('/[^a-z0-9_]/i', '', $_REQUEST['site']), 0, 2) : '';
if ($siteID !== '') {
define('SITE_ID', $siteID);
}
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php';
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule('crm') || !CCrmSecurityHelper::IsAuthorized() || !check_bitrix_sessid()) {
die;
}
$params = isset($_REQUEST['PARAMS']) ? $_REQUEST['PARAMS'] : array();
$entityTypeName = isset($params['ENTITY_TYPE_NAME']) ? strtoupper($params['ENTITY_TYPE_NAME']) : '';
if ($entityTypeName === '') {
die;
}
$entityTypeID = CCrmOwnerType::ResolveID($entityTypeName);
if ($entityTypeID === CCrmOwnerType::Undefined) {
die;
}
$entityID = isset($params['ENTITY_ID']) ? $params['ENTITY_ID'] : 0;
if ($entityID <= 0) {
die;
}
示例2: Header
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
if (!empty($result)) {
echo json_encode($result);
}
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_after.php';
die;
}
}
if (CModule::IncludeModule('compression')) {
CCompress::Disable2048Spaces();
}
CUtil::JSPostUnescape();
if (!CModule::IncludeModule('crm')) {
__CrmMobileFileEndResonse(array('error' => 'Could not include "crm" module.'));
}
if (!(check_bitrix_sessid() && CCrmSecurityHelper::IsAuthorized())) {
__CrmMobileFileEndResonse(array('error' => 'Access denied.'));
}
global $APPLICATION;
if ($_SERVER['REQUEST_METHOD'] === 'POST' && is_array($_FILES) && !empty($_FILES)) {
$ID = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
$hasPermission = $ID > 0 ? CCrmContact::CheckUpdatePermission($ID) : CCrmContact::CheckCreatePermission();
if (!$hasPermission) {
__CrmMobileFileEndResonse(array('error' => 'Access denied.'));
} else {
$result = array();
if (!CCrmMobileHelper::TryUploadFile($result, array('OWNER_TYPE_ID' => CCrmOwnerType::Contact, 'OWNER_ID' => $ID, 'SCOPE' => 'I', 'MAX_FILE_SIZE' => 5242880))) {
__CrmMobileFileEndResonse(array('error' => $result['ERROR_MESSAGE']));
} else {
$fileID = $result['FILE_ID'];
$fileInfo = CFile::ResizeImageGet($fileID, array('width' => 55, 'height' => 55), BX_RESIZE_IMAGE_EXACT, false, false, true);
示例3: define
<?php
define('NO_KEEP_STATISTIC', 'Y');
define('NO_AGENT_STATISTIC', 'Y');
define('NO_AGENT_CHECK', true);
define('PUBLIC_AJAX_MODE', true);
define('DisableEventsCheck', true);
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php';
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule('crm') || !CCrmSecurityHelper::IsAuthorized() || !check_bitrix_sessid() || $_SERVER['REQUEST_METHOD'] != 'POST') {
die;
}
$action = isset($_REQUEST['ACTION']) ? $_REQUEST['ACTION'] : '';
if ($action === '') {
die;
}
global $APPLICATION;
if ($action === 'INDEX') {
$entityTypeName = isset($_REQUEST['ENTITY_TYPE_NAME']) ? $_REQUEST['ENTITY_TYPE_NAME'] : '';
if ($entityTypeName !== CCrmOwnerType::DealName) {
die;
}
$entityID = isset($_REQUEST['ENTITY_ID']) ? intval($_REQUEST['ENTITY_ID']) : 0;
if ($entityID <= 0) {
die;
}
$params = isset($_REQUEST['PARAMS']) && is_array($_REQUEST['PARAMS']) ? $_REQUEST['PARAMS'] : array();
$formID = isset($params['FORM_ID']) ? $params['FORM_ID'] : '';
$tabKey = $formID !== '' ? "{$formID}_active_tab" : 'active_tab';
示例4: __CrmCompanyEditEndResonse
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_after.php';
die;
}
}
if (!CModule::IncludeModule('crm')) {
__CrmCompanyEditEndResonse(array('ERROR' => 'Could not include crm module.'));
}
/*
* ONLY 'POST' METHOD SUPPORTED
* SUPPORTED ACTIONS:
* 'SAVE_COMPANY'
* 'ENABLE_SONET_SUBSCRIPTION'
* 'FIND_DUPLICATES'
* 'FIND_LOCALITIES'
*/
if (!CCrmSecurityHelper::IsAuthorized() || !check_bitrix_sessid()) {
__CrmCompanyEditEndResonse(array('ERROR' => 'Access denied.'));
}
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
__CrmCompanyEditEndResonse(array('ERROR' => 'Request method is not allowed.'));
}
__IncludeLang(dirname(__FILE__) . '/lang/' . LANGUAGE_ID . '/' . basename(__FILE__));
CUtil::JSPostUnescape();
$GLOBALS['APPLICATION']->RestartBuffer();
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
$action = isset($_POST['ACTION']) ? $_POST['ACTION'] : '';
if ($action === 'SAVE_COMPANY') {
$data = isset($_POST['DATA']) && is_array($_POST['DATA']) ? $_POST['DATA'] : array();
if (count($data) == 0) {
echo CUtil::PhpToJSObject(array('ERROR' => 'SOURCE DATA ARE NOT FOUND!'));
die;
示例5: define
<?php
define('STOP_STATISTICS', true);
define('BX_SECURITY_SHOW_MESSAGE', true);
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php';
if (!CModule::IncludeModule('crm')) {
return;
}
if (!CCrmSecurityHelper::IsAuthorized() || $_REQUEST['MODE'] != 'SEARCH') {
return;
}
$bResultWithValue = isset($_REQUEST['RESULT_WITH_VALUE']) && $_REQUEST['RESULT_WITH_VALUE'] === 'Y';
$CrmPerms = CCrmPerms::GetCurrentUserPermissions();
if (!(CCrmPerms::IsAccessEnabled($CrmPerms) && $CrmPerms->HavePerm('CONFIG', BX_CRM_PERM_CONFIG, 'READ'))) {
return;
}
__IncludeLang(dirname(__FILE__) . '/lang/' . LANGUAGE_ID . '/' . basename(__FILE__));
CUtil::JSPostUnescape();
$GLOBALS['APPLICATION']->RestartBuffer();
$search = trim($_REQUEST['VALUE']);
$multi = isset($_REQUEST['MULTI']) && $_REQUEST['MULTI'] == 'Y' ? true : false;
$arData = array();
$enableSearchByID = true;
if (isset($_REQUEST['ENABLE_SEARCH_BY_ID'])) {
$enableSearchByID = strtoupper($_REQUEST['ENABLE_SEARCH_BY_ID']) === 'Y';
}
if ($enableSearchByID && is_numeric($search)) {
$arFilter['ID'] = (int) $search;
} elseif (preg_match('/(.*)\\[(\\d+?)\\]/i' . BX_UTF_PCRE_MODIFIER, $search, $arMatches)) {
$arFilter['ID'] = intval($arMatches[2]);
$arFilter['%NAME'] = trim($arMatches[1]);
示例6: ShowError
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule('crm')) {
ShowError(GetMessage('CRM_MODULE_NOT_INSTALLED'));
return;
}
if (!(CCrmSecurityHelper::IsAuthorized() && CCrmPerms::IsAccessEnabled())) {
ShowError(GetMessage('CRM_PERMISSION_DENIED'));
return;
}
global $APPLICATION;
$arParams['NAME_TEMPLATE'] = empty($arParams['NAME_TEMPLATE']) ? CSite::GetNameFormat(false) : str_replace(array('#NOBR#', '#/NOBR#'), array('', ''), $arParams['NAME_TEMPLATE']);
$uid = isset($arParams['UID']) ? $arParams['UID'] : '';
if ($uid === '') {
$uid = 'mobile_crm_config_user_email';
}
$arResult['UID'] = $arParams['UID'] = $uid;
$currentUserID = $arResult['USER_ID'] = CCrmSecurityHelper::GetCurrentUserID();
$dbUser = CUser::GetList($by = 'id', $order = 'asc', array('ID_EQUAL_EXACT' => $currentUserID), array('FIELDS' => array('LOGIN', 'NAME', 'SECOND_NAME', 'LAST_NAME', 'EMAIL', 'PERSONAL_PHOTO')));
$user = $dbUser->Fetch();
$contextID = isset($arParams['CONTEXT_ID']) ? $arParams['CONTEXT_ID'] : '';
if ($contextID === '' && isset($_REQUEST['context_id'])) {
$contextID = $_REQUEST['context_id'];
}
$arResult['CONTEXT_ID'] = $contextID;
$arResult['CRM_EMAIL'] = CCrmMailHelper::ExtractEmail(COption::GetOptionString('crm', 'mail', ''));
$arResult['USER_FULL_NAME'] = CUser::FormatName($arParams['NAME_TEMPLATE'], array('LOGIN' => isset($user['LOGIN']) ? $user['LOGIN'] : '', 'NAME' => isset($user['NAME']) ? $user['NAME'] : '', 'SECOND_NAME' => isset($user['SECOND_NAME']) ? $user['SECOND_NAME'] : '', 'LAST_NAME' => isset($user['LAST_NAME']) ? $user['LAST_NAME'] : ''), true, false);
$arResult['USER_EMAIL'] = isset($user['EMAIL']) ? $user['EMAIL'] : '';
示例7: ShowError
}
if (!CModule::IncludeModule('iblock')) {
ShowError(GetMessage("CRM_PRODUCT_FILE_IBLOCK_MODULE_NOT_INSTALLED"));
return;
}
$arParams['PATH_TO_PRODUCT_FILE'] = CrmCheckPath('PATH_TO_PRODUCT_FILE', $arParams['PATH_TO_PRODUCT_FILE'], $APPLICATION->GetCurPage() . '?product_id=#product_id#&field_id=#field_id#&file_id=#file_id#&file');
$IBLOCK_ID = is_array($arParams["~CATALOG_ID"]) ? 0 : intval($arParams["~CATALOG_ID"]);
$ELEMENT_ID = is_array($arParams["~PRODUCT_ID"]) ? 0 : intval($arParams["~PRODUCT_ID"]);
/*$SECTION_ID = is_array($arParams["~SECTION_ID"])? 0: intval($arParams["~SECTION_ID"]);*/
/*$lists_perm = CListPermissions::CheckAccess(
$USER,
$arParams["~IBLOCK_TYPE_ID"],
$IBLOCK_ID,
$arParams["~SOCNET_GROUP_ID"]
);*/
if (!CCrmSecurityHelper::IsAuthorized()) {
ShowError(GetMessage('CRM_PRODUCT_FILE_PERMISSION_DENIED'));
return;
}
$CrmPerms = CCrmPerms::GetCurrentUserPermissions();
if (!(CCrmPerms::IsAccessEnabled($CrmPerms) && $CrmPerms->HavePerm('CONFIG', BX_CRM_PERM_CONFIG, 'READ'))) {
ShowError(GetMessage('CRM_PRODUCT_FILE_PERMISSION_DENIED'));
return;
}
if (!CCrmProductFile::CheckFieldId($IBLOCK_ID, $arParams["FIELD_ID"])) {
ShowError(GetMessage("CRM_PRODUCT_FILE_UNKNOWN_ERROR"));
return;
}
/*else if ($lists_perm < 0)
{
switch ($lists_perm)
示例8: define
define('NO_KEEP_STATISTIC', 'Y');
define('NO_AGENT_STATISTIC', 'Y');
define('NO_AGENT_CHECK', true);
define('DisableEventsCheck', true);
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php';
if (!CModule::IncludeModule('crm')) {
return;
}
/*
* ONLY 'POST' METHOD SUPPORTED
* SUPPORTED ACTIONS:
* 'ENABLE_SONET_SUBSCRIPTION'
*/
global $DB, $APPLICATION;
if (!CCrmSecurityHelper::IsAuthorized() || !check_bitrix_sessid() || $_SERVER['REQUEST_METHOD'] != 'POST') {
return;
}
__IncludeLang(dirname(__FILE__) . '/lang/' . LANGUAGE_ID . '/' . basename(__FILE__));
CUtil::JSPostUnescape();
$APPLICATION->RestartBuffer();
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
$action = isset($_POST['ACTION']) ? $_POST['ACTION'] : '';
if (strlen($action) == 0) {
echo CUtil::PhpToJSObject(array('ERROR' => 'INVALID DATA!'));
die;
}
if ($action === 'ENABLE_SONET_SUBSCRIPTION') {
$userID = CCrmSecurityHelper::GetCurrentUserID();
$entityTypeName = isset($_POST['ENTITY_TYPE']) ? strtoupper($_POST['ENTITY_TYPE']) : '';
$entityID = isset($_POST['ENTITY_ID']) ? intval($_POST['ENTITY_ID']) : 0;