本文整理汇总了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');
}