本文整理汇总了PHP中kCurrentContext::getCurrentSessionType方法的典型用法代码示例。如果您正苦于以下问题:PHP kCurrentContext::getCurrentSessionType方法的具体用法?PHP kCurrentContext::getCurrentSessionType怎么用?PHP kCurrentContext::getCurrentSessionType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kCurrentContext
的用法示例。
在下文中一共展示了kCurrentContext::getCurrentSessionType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListResponse
/**
* @param KalturaFilterPager $pager
* @param KalturaDetachedResponseProfile $responseProfile
* @return KalturaListResponse
*/
public function getListResponse(KalturaFilterPager $pager, KalturaDetachedResponseProfile $responseProfile = null)
{
$response = new KalturaUserEntryListResponse();
if (in_array(kCurrentContext::getCurrentSessionType(), array(kSessionBase::SESSION_TYPE_NONE, kSessionBase::SESSION_TYPE_WIDGET))) {
$response->totalCount = 0;
return $response;
}
$c = new Criteria();
if (!is_null($this->userIdEqualCurrent) && $this->userIdEqualCurrent) {
$this->userIdEqual = kCurrentContext::getCurrentKsKuserId();
} else {
$this->fixFilterUserId();
}
$userEntryFilter = $this->toObject();
$userEntryFilter->attachToCriteria($c);
$pager->attachToCriteria($c);
$list = UserEntryPeer::doSelect($c);
$resultCount = count($list);
if ($resultCount && $resultCount < $pager->pageSize) {
$totalCount = ($pager->pageIndex - 1) * $pager->pageSize + $resultCount;
} else {
KalturaFilterPager::detachFromCriteria($c);
$totalCount = UserEntryPeer::doCount($c);
}
$response->totalCount = $totalCount;
$response->objects = KalturaUserEntryArray::fromDbArray($list, $responseProfile);
return $response;
}
示例2: getObjectTypeCacheKey
private static function getObjectTypeCacheKey(IRelatedObject $object)
{
$userRoles = kPermissionManager::getCurrentRoleIds();
sort($userRoles);
$objectType = get_class($object);
$partnerId = self::$cachedObject->getPartnerId();
$profileKey = self::$responseProfileKey;
$protocol = infraRequestUtils::getProtocol();
$ksType = kCurrentContext::getCurrentSessionType();
$userRoles = implode('-', $userRoles);
$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
return "relate_rp{$profileKey}_p{$partnerId}_o{$objectType}_h{$protocol}_k{$ksType}_u{$userRoles}_w{$host}";
}
示例3: doFromObject
public function doFromObject($sourceObject, KalturaDetachedResponseProfile $responseProfile = null)
{
if (!$sourceObject) {
return;
}
entryPeer::addValidatedEntry($sourceObject->getId());
parent::doFromObject($sourceObject, $responseProfile);
$partnerId = kCurrentContext::$ks_partner_id ? kCurrentContext::$ks_partner_id : kCurrentContext::$partner_id;
if (implode(',', kEntitlementUtils::getKsPrivacyContext()) != kEntitlementUtils::DEFAULT_CONTEXT . $partnerId) {
$this->categories = null;
$this->categoriesIds = null;
}
if (!kConf::hasParam('protect_userid_in_api') || !in_array($sourceObject->getPartnerId(), kConf::get('protect_userid_in_api')) || !in_array(kCurrentContext::getCurrentSessionType(), array(kSessionBase::SESSION_TYPE_NONE, kSessionBase::SESSION_TYPE_WIDGET))) {
if ($this->shouldGet('userId', $responseProfile)) {
$this->userId = $sourceObject->getPuserId();
}
if ($this->shouldGet('creatorId', $responseProfile)) {
$this->creatorId = $sourceObject->getCreatorPuserId();
}
}
}
示例4: getSessionKey
protected static function getSessionKey($protocol = null, $ksType = null, array $userRoles = null, $host = null)
{
if (!$protocol) {
$protocol = infraRequestUtils::getProtocol();
}
if (!$ksType) {
$ksType = kCurrentContext::getCurrentSessionType();
}
if (!$userRoles) {
$userRoles = kPermissionManager::getCurrentRoleIds();
}
if (!$host) {
$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
}
sort($userRoles);
$userRole = implode('-', $userRoles);
return "{$protocol}_{$ksType}_{$host}_{$userRole}";
}
示例5: doFromObject
public function doFromObject($dbCuePoint, KalturaDetachedResponseProfile $responseProfile = null)
{
parent::doFromObject($dbCuePoint, $responseProfile);
if ($this->shouldGet('userId', $responseProfile)) {
if ($dbCuePoint->getKuserId() !== null) {
$dbKuser = kuserPeer::retrieveByPK($dbCuePoint->getKuserId());
if ($dbKuser) {
if (!kConf::hasParam('protect_userid_in_api') || !in_array($dbCuePoint->getPartnerId(), kConf::get('protect_userid_in_api')) || !in_array(kCurrentContext::getCurrentSessionType(), array(kSessionBase::SESSION_TYPE_NONE, kSessionBase::SESSION_TYPE_WIDGET))) {
$this->userId = $dbKuser->getPuserId();
}
}
}
}
}