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


PHP CCrmSecurityHelper::GetCurrentUser方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:17,代码来源:sonet_subscription.php

示例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';
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php

示例3: IsAuthorized

 public static function IsAuthorized()
 {
     return CCrmSecurityHelper::GetCurrentUser()->IsAuthorized();
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:4,代码来源:crm_perms.php

示例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));
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:21,代码来源:restservice.php

示例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');
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:7,代码来源:crm_authorization_helper.php


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