本文整理匯總了PHP中CCrmSecurityHelper::GetCurrentUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCrmSecurityHelper::GetCurrentUser方法的具體用法?PHP CCrmSecurityHelper::GetCurrentUser怎麽用?PHP CCrmSecurityHelper::GetCurrentUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CCrmSecurityHelper
的用法示例。
在下文中一共展示了CCrmSecurityHelper::GetCurrentUser方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: EnsureAllResponsibilityImported
public static function EnsureAllResponsibilityImported($userID, $reset = false)
{
$userID = intval($userID);
if ($userID <= 0) {
$userID = CCrmSecurityHelper::GetCurrentUser();
}
$reset = (bool) $reset;
$optionName = 'sl_subscr_import';
if ($reset || CUserOptions::GetOption('crm', $optionName, 'N', $userID) !== 'Y') {
self::EnsureResponsibilityImported(CCrmOwnerType::Lead, $userID);
self::EnsureResponsibilityImported(CCrmOwnerType::Contact, $userID);
self::EnsureResponsibilityImported(CCrmOwnerType::Company, $userID);
self::EnsureResponsibilityImported(CCrmOwnerType::Deal, $userID);
self::EnsureResponsibilityImported(CCrmOwnerType::Activity, $userID);
CUserOptions::SetOption('crm', $optionName, 'Y', false, $userID);
}
}
示例2: define
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/bx_root.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php';
if (!defined('LANGUAGE_ID')) {
$dbSite = CSite::GetByID(SITE_ID);
$arSite = $dbSite ? $dbSite->Fetch() : null;
define('LANGUAGE_ID', $arSite ? $arSite['LANGUAGE_ID'] : 'en');
}
//session_write_close();
if (!CModule::IncludeModule('crm')) {
die;
}
if (CModule::IncludeModule('compression')) {
CCompress::Disable2048Spaces();
}
global $APPLICATION, $DB;
$curUser = CCrmSecurityHelper::GetCurrentUser();
if (!$curUser || !$curUser->IsAuthorized() || !check_bitrix_sessid() || $_SERVER['REQUEST_METHOD'] != 'POST') {
die;
}
//$langID = isset($_REQUEST['lang_id'])? $_REQUEST['lang_id']: LANGUAGE_ID;
//__IncludeLang(dirname(__FILE__).'/lang/'.$langID.'/'.basename(__FILE__));
CUtil::JSPostUnescape();
if (!function_exists('__CrmMobileDealEditEndResonse')) {
function __CrmMobileDealEditEndResonse($result)
{
$GLOBALS['APPLICATION']->RestartBuffer();
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
if (!empty($result)) {
echo CUtil::PhpToJSObject($result);
}
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_after.php';
示例3: IsAuthorized
public static function IsAuthorized()
{
return CCrmSecurityHelper::GetCurrentUser()->IsAuthorized();
}
示例4: getWebDavSettings
protected function getWebDavSettings()
{
if ($this->webdavSettings !== null) {
return $this->webdavSettings;
}
if (!CModule::IncludeModule('webdav')) {
throw new RestException('Could not load webdav module.');
}
$opt = COption::getOptionString('webdav', 'user_files', null);
if ($opt == null) {
throw new RestException('Could not find webdav settings.');
}
$user = CCrmSecurityHelper::GetCurrentUser();
$opt = unserialize($opt);
$iblockID = intval($opt[CSite::GetDefSite()]['id']);
$userSectionID = CWebDavIblock::getRootSectionIdForUser($iblockID, $user->GetID());
if (!is_numeric($userSectionID) || $userSectionID <= 0) {
throw new RestException('Could not find webdav section for user ' . $user->GetLastName() . '.');
}
return $this->webdavSettings = array('IBLOCK_ID' => $iblockID, 'IBLOCK_SECTION_ID' => intval($userSectionID));
}
示例5: CanEditOtherSettings
public static function CanEditOtherSettings($user = null)
{
if (!($user !== null && (get_class($user) === 'CUser' || $user instanceof CUser))) {
$user = CCrmSecurityHelper::GetCurrentUser();
}
return $user->CanDoOperation('edit_other_settings');
}