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


PHP SecurityToken::getAppId方法代码示例

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


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

示例1: deletePersonData

 /**
  * Delete PersonAppData
  *
  * @param
  *   $userId for who data is to be deleted
  * @param
  *   $groupId of the user
  * @param
  *   $appId to which all Appdata belongs to
  * @param
  *   $feilds array of Appdata needs to be deleted 
  * @param
  *   $token security token for validation
  */
 public function deletePersonData($userId, GroupId $groupId, $appId, $fields, SecurityToken $token)
 {
     if ($fields == null || $fields[0] == '*') {
         $key = "*";
         if (!ShindigIntegratorDbFetcher::get()->deleteAppData($userId, $key, $token->getAppId())) {
             throw new SocialSpiException("Internal server error", ResponseError::$INTERNAL_ERROR);
         }
         return null;
     }
     foreach ($fields as $key) {
         if (!ShindigIntegratorAppDataService::isValidKey($key)) {
             throw new SocialSpiException("The person app data key had invalid characters", ResponseError::$BAD_REQUEST);
         }
     }
     switch ($groupId->getType()) {
         case 'self':
             foreach ($fields as $key) {
                 if (!ShindigIntegratorDbFetcher::get()->deleteAppData($userId, $key, $token->getAppId())) {
                     throw new SocialSpiException("Internal server error", ResponseError::$INTERNAL_ERROR);
                 }
             }
             break;
         default:
             throw new SocialSpiException("Not Implemented", ResponseError::$NOT_IMPLEMENTED);
             break;
     }
     return null;
 }
开发者ID:jakob-stoeck,项目名称:os_poker,代码行数:42,代码来源:ShindigIntegratorAppDataService.php

示例2: getAppId

 /**
  *
  * @return int
  */
 public function getAppId()
 {
     $appId = $this->getParameter(self::$APP_ID);
     if ($appId != null && $appId == self::$APP_SUBSTITUTION_TOKEN) {
         return $this->token->getAppId();
     } else {
         return $appId;
     }
 }
开发者ID:newlongwhitecloudy,项目名称:OpenConext-engineblock,代码行数:13,代码来源:RequestItem.php

示例3: getKey

 protected function getKey($userId, SecurityToken $token)
 {
     $pos = strrpos($userId, ':');
     if ($pos !== false) {
         $userId = substr($userId, $pos + 1);
     }
     if ($token->getAppId()) {
         return self::$TOKEN_PREFIX . $token->getAppId() . '_' . $userId;
     }
     return self::$TOKEN_PREFIX . $token->getAppUrl() . '_' . $userId;
 }
开发者ID:rysk92,项目名称:opOpenSocialPlugin,代码行数:11,代码来源:OpenPNEInvalidateService.php

示例4: getAppId

 public static function getAppId($appId, SecurityToken $token)
 {
     if ($appId == '@app') {
         return $token->getAppId();
     } else {
         return $appId;
     }
 }
开发者ID:emma5021,项目名称:toba,代码行数:8,代码来源:DataRequestHandler.php

示例5: createMessage

 public function createMessage($userId, $appId, $message, $optionalMessageId, SecurityToken $token)
 {
     try {
         $messages = ATutorDbFetcher::get()->createMessage($userId, $token->getAppId(), $message);
     } catch (SocialSpiException $e) {
         throw $e;
     } catch (Exception $e) {
         throw new SocialSpiException("Invalid create message request: " . $e->getMessage(), ResponseError::$INTERNAL_ERROR);
     }
 }
开发者ID:genaromendezl,项目名称:ATutor,代码行数:10,代码来源:ATutorMessagesService.php

示例6: getKey

 /**
  * @return string
  */
 private function getKey($userId, SecurityToken $token)
 {
     $pos = strrpos($userId, ':');
     if ($pos !== false) {
         $userId = substr($userId, $pos + 1);
     }
     if ($token->getAppId()) {
         return DefaultInvalidateService::$TOKEN_PREFIX . $token->getAppId() . '_' . $userId;
     }
     return DefaultInvalidateService::$TOKEN_PREFIX . $token->getAppUrl() . '_' . $userId;
 }
开发者ID:niryuu,项目名称:opOpenSocialPlugin,代码行数:14,代码来源:DefaultInvalidateService.php

示例7: 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

示例8: createActivity

 public function createActivity($userId, $groupId, $appId, $fields, $activity, SecurityToken $token)
 {
     $db = $this->getDb();
     $activitiesTable = $this->getAllActivities();
     $activity['appId'] = $token->getAppId();
     try {
         if (!isset($activitiesTable[$userId->getUserId($token)])) {
             $activitiesTable[$userId->getUserId($token)] = array();
         }
         $activity['id'] = count($activitiesTable[$userId->getUserId($token)]) + 1;
         array_push($activitiesTable[$userId->getUserId($token)], $activity);
         $db[self::$ACTIVITIES_TABLE] = $activitiesTable;
         $this->saveDb($db);
         // Should this return something to show success?
     } catch (Exception $e) {
         throw new SocialSpiException("Activity can't be created: " . $e->getMessage(), ResponseError::$INTERNAL_ERROR);
     }
 }
开发者ID:ndkhoiits,项目名称:gatein-shindig,代码行数:18,代码来源:JsonDbOpensocialService.php

示例9: createActivity

 public function createActivity($userId, $groupId, $appId, $fields, $activity, SecurityToken $token)
 {
     if ($appId == $token->getAppId()) {
         $appId = '@app';
     }
     $q = array(array('method' => 'activities.create', 'params' => array('userId' => $this->getIdSet($userId, $token), 'groupId' => $this->getGroupId($groupId), 'appId' => $appId, 'activity' => $activity), 'id' => 'key'));
     $this->fetch($q, $token);
     return null;
 }
开发者ID:rysk92,项目名称:opOpenSocialPlugin,代码行数:9,代码来源:OpenPNEService.php

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