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


PHP SecurityToken::getViewerId方法代码示例

本文整理汇总了PHP中SecurityToken::getViewerId方法的典型用法代码示例。如果您正苦于以下问题:PHP SecurityToken::getViewerId方法的具体用法?PHP SecurityToken::getViewerId怎么用?PHP SecurityToken::getViewerId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SecurityToken的用法示例。


在下文中一共展示了SecurityToken::getViewerId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getUsers

 /**
  *
  * @return array
  */
 public function getUsers()
 {
     $ids = $this->getListParameter(self::$USER_ID);
     if (empty($ids)) {
         if ($this->token->getViewerId() != null) {
             // Assume @me
             $ids = array("@me");
         } else {
             throw new IllegalArgumentException("No userId provided and viewer not available");
         }
     }
     $userIds = array();
     foreach ($ids as $id) {
         $userIds[] = UserId::fromJson($id);
     }
     return $userIds;
 }
开发者ID:newlongwhitecloudy,项目名称:OpenConext-engineblock,代码行数:21,代码来源:RequestItem.php

示例2: createActivity

 public function createActivity($userId, $groupId, $appId, $fields, $activity, SecurityToken $token)
 {
     try {
         if ($token->getOwnerId() != $token->getViewerId()) {
             throw new SocialSpiException("unauthorized: Create activity permission denied.", ResponseError::$UNAUTHORIZED);
         }
         ATutorDbFetcher::get()->createActivity($userId->getUserId($token), $activity, $token->getAppId());
     } catch (SocialSpiException $e) {
         throw $e;
     } catch (Exception $e) {
         throw new SocialSpiException("Invalid create activity request: " . $e->getMessage(), ResponseError::$INTERNAL_ERROR);
     }
 }
开发者ID:genaromendezl,项目名称:ATutor,代码行数:13,代码来源:ATutorActivityService.php

示例3: getUserId

 public function getUserId(SecurityToken $token)
 {
     switch ($this->type) {
         case 'viewer':
             return $token->getViewerId();
             break;
         case 'owner':
             return $token->getOwnerId();
             break;
         case 'userId':
             return $this->userId;
             break;
         default:
             throw new Exception("The type field is not a valid enum: {$this->type}");
             break;
     }
 }
开发者ID:ahmedadham88,项目名称:enhanced-social-network,代码行数:17,代码来源:UserId.php

示例4: addIdentityParams

 private static function addIdentityParams(array &$params, SecurityToken $token)
 {
     $params['opensocial_owner_id'] = $token->getOwnerId();
     $params['opensocial_viewer_id'] = $token->getViewerId();
     $params['opensocial_app_id'] = $token->getAppId();
     $params['opensocial_app_url'] = $token->getAppUrl();
 }
开发者ID:kevinj,项目名称:apache-incubator-shindig,代码行数:7,代码来源:OAuthFetcher.php

示例5: addOpenSocialParams

 private function addOpenSocialParams(&$msgParams, SecurityToken $token, $signOwner, $signViewer)
 {
     if ($signOwner) {
         $owner = $token->getOwnerId();
         if ($owner != null) {
             $msgParams[SigningFetcher::$OPENSOCIAL_OWNERID] = $owner;
         }
     }
     if ($signViewer) {
         $viewer = $token->getViewerId();
         if ($viewer != null) {
             $msgParams[SigningFetcher::$OPENSOCIAL_VIEWERID] = $viewer;
         }
     }
     if ($signOwner || $signViewer) {
         $app = $token->getAppId();
         if ($app != null) {
             $msgParams[SigningFetcher::$OPENSOCIAL_APPID] = $app;
         }
         $url = $token->getAppUrl();
         if ($url != null) {
             $msgParams[SigningFetcher::$OPENSOCIAL_APPURL] = $url;
         }
     }
 }
开发者ID:vuxuandung,项目名称:Partuza-bundle,代码行数:25,代码来源:SigningFetcher.php


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