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


PHP OAuthRequestLogger::finish方法代码示例

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


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

示例1: verifyIfSigned

 /**
  * Verify the request if it seemed to be signed.
  * 
  * @param string token_type the kind of token needed, defaults to 'access'
  * @exception OAuthException thrown when the request did not verify
  * @return boolean	true when signed, false when not signed
  */
 public function verifyIfSigned($token_type = 'access')
 {
     if ($this->getParam('oauth_consumer_key')) {
         OAuthRequestLogger::start($this);
         $this->verify($token_type);
         $signed = true;
         OAuthRequestLogger::finish();
     } else {
         $signed = false;
     }
     return $signed;
 }
开发者ID:phill104,项目名称:branches,代码行数:19,代码来源:OAuthRequestVerifier.php

示例2: authorizeFinish

 /**
  * Overrule this method when you want to want to display a nice page when
  * the authorization is finished.  This function does not know if the authorization was
  * succesfull, you need to check the token in the database.
  */
 public function authorizeFinish($authorized, $user_id)
 {
     OAuthRequestLogger::start($this);
     $token = $this->getParam('oauth_token', true);
     if (isset($_SESSION['verify_oauth_token']) && $_SESSION['verify_oauth_token'] == $token) {
         // Flag the token as authorized, or remove the token when not authorized
         $store = OAuthStore::instance();
         if ($authorized) {
             OAuthRequestLogger::addNote('Authorized token "' . $token . '" for user ' . $user_id);
             $store->authorizeConsumerRequestToken($token, $user_id);
         } else {
             OAuthRequestLogger::addNote('Authorization rejected for token "' . $token . '" for user ' . $user_id . "\nToken has been deleted");
             $store->deleteConsumerRequestToken($token);
         }
         if (!empty($_SESSION['verify_oauth_callback'])) {
             $this->redirect($_SESSION['verify_oauth_callback'], array('oauth_token' => rawurlencode($token)));
         }
     }
     OAuthRequestLogger::finish();
 }
开发者ID:phill104,项目名称:branches,代码行数:25,代码来源:OAuthServer.php


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