當前位置: 首頁>>代碼示例>>PHP>>正文


PHP kCurrentContext::getCurrentSessionType方法代碼示例

本文整理匯總了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;
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:33,代碼來源:KalturaUserEntryFilter.php

示例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}";
 }
開發者ID:ace3535,項目名稱:server,代碼行數:13,代碼來源:KalturaResponseProfileCacher.php

示例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();
         }
     }
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:21,代碼來源:KalturaBaseEntry.php

示例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}";
 }
開發者ID:dozernz,項目名稱:server,代碼行數:18,代碼來源:kResponseProfileCacher.php

示例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();
                 }
             }
         }
     }
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:14,代碼來源:KalturaCuePoint.php


注:本文中的kCurrentContext::getCurrentSessionType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。