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


PHP OAuthRequestLogger::addNote方法代码示例

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


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

示例1: __construct

 function __construct($message)
 {
     Exception::__construct($message);
     OAuthRequestLogger::addNote('OAuthException2: ' . $message);
     if ($debug) {
         echo message;
     }
 }
开发者ID:shinichi81,项目名称:HackTheBank,代码行数:8,代码来源:OAuthException2.php

示例2: authorizeFinish

 /**
  * Overrule this method when you 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.
  * 
  * @param boolean authorized	if the current token (oauth_token param) is authorized or not
  * @param int user_id			user for which the token was authorized (or denied)
  * @return string verifier  For 1.0a Compatibility
  */
 public function authorizeFinish($authorized, $user_id)
 {
     OAuthRequestLogger::start($this);
     $token = $this->getParam('oauth_token', true);
     $verifier = null;
     if ($this->session->get('verify_oauth_token') == $token) {
         // Flag the token as authorized, or remove the token when not authorized
         $store = OAuthStore::instance();
         // Fetch the referrer host from the oauth callback parameter
         $referrer_host = '';
         $oauth_callback = false;
         $verify_oauth_callback = $this->session->get('verify_oauth_callback');
         if (!empty($verify_oauth_callback) && $verify_oauth_callback != 'oob') {
             $oauth_callback = $this->session->get('verify_oauth_callback');
             $ps = parse_url($oauth_callback);
             if (isset($ps['host'])) {
                 $referrer_host = $ps['host'];
             }
         }
         if ($authorized) {
             OAuthRequestLogger::addNote('Authorized token "' . $token . '" for user ' . $user_id . ' with referrer "' . $referrer_host . '"');
             // 1.0a Compatibility : create a verifier code
             $verifier = $store->authorizeConsumerRequestToken($token, $user_id, $referrer_host);
         } else {
             OAuthRequestLogger::addNote('Authorization rejected for token "' . $token . '" for user ' . $user_id . "\nToken has been deleted");
             $store->deleteConsumerRequestToken($token);
         }
         if (!empty($oauth_callback)) {
             $params = array('oauth_token' => rawurlencode($token));
             // 1.0a Compatibility : if verifier code has been generated, add it to the URL
             if ($verifier) {
                 $params['oauth_verifier'] = $verifier;
             }
             $uri = preg_replace('/\\s/', '%20', $oauth_callback);
             if (!empty($this->allowed_uri_schemes)) {
                 if (!in_array(substr($uri, 0, strpos($uri, '://')), $this->allowed_uri_schemes)) {
                     throw new OAuthException2('Illegal protocol in redirect uri ' . $uri);
                 }
             } else {
                 if (!empty($this->disallowed_uri_schemes)) {
                     if (in_array(substr($uri, 0, strpos($uri, '://')), $this->disallowed_uri_schemes)) {
                         throw new OAuthException2('Illegal protocol in redirect uri ' . $uri);
                     }
                 }
             }
             $this->redirect($oauth_callback, $params);
         }
     }
     OAuthRequestLogger::flush();
     return $verifier;
 }
开发者ID:jjsub,项目名称:samesub,代码行数:60,代码来源:OAuthServer.php

示例3: authorizeFinish

 /**
  * Overrule this method when you 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.
  * 
  * @param boolean authorized	if the current token (oauth_token param) is authorized or not
  * @param int user_id			user for which the token was authorized (or denied)
  */
 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();
         // Fetch the referrer host from the oauth callback parameter
         $referrer_host = '';
         $oauth_callback = false;
         if (!empty($_SESSION['verify_oauth_callback'])) {
             $oauth_callback = $_SESSION['verify_oauth_callback'];
             $ps = j_parseUrl($oauth_callback);
             if (isset($ps['host'])) {
                 $referrer_host = $ps['host'];
             }
         }
         if ($authorized) {
             OAuthRequestLogger::addNote('Authorized token "' . $token . '" for user ' . $user_id . ' with referrer "' . $referrer_host . '"');
             $store->authorizeConsumerRequestToken($token, $user_id, $referrer_host);
         } else {
             OAuthRequestLogger::addNote('Authorization rejected for token "' . $token . '" for user ' . $user_id . "\nToken has been deleted");
             $store->deleteConsumerRequestToken($token);
         }
         if (!empty($oauth_callback)) {
             $this->redirect($oauth_callback, array('oauth_token' => rawurlencode($token)));
         }
     }
     OAuthRequestLogger::flush();
 }
开发者ID:voota,项目名称:voota,代码行数:38,代码来源:OAuthServer.php

示例4: __construct

 function __construct($message)
 {
     Exception::__construct($message);
     OAuthRequestLogger::addNote('OAuthException: ' . $message);
     die("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" . '<api_error>' . $message . '</api_error>');
 }
开发者ID:phill104,项目名称:branches,代码行数:6,代码来源:OAuthException.php

示例5: __construct

 function __construct($message)
 {
     Exception::__construct($message);
     OAuthRequestLogger::addNote('OAuthException: ' . $message);
 }
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:5,代码来源:OAuthException.php

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