當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。