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


PHP Auth_OpenID_ServiceEndpointLoader::fromSession方法代码示例

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


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

示例1: prepareForLoad

 function prepareForLoad($data)
 {
     $loader = new Auth_OpenID_ServiceEndpointLoader();
     $services = array();
     foreach ($data['services'] as $s) {
         $services[] = $loader->fromSession($s);
     }
     return array('services' => $services);
 }
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:9,代码来源:Manager.php

示例2: complete

 /**
  * Called to interpret the server's response to an OpenID
  * request. It is called in step 4 of the flow described in the
  * consumer overview.
  *
  * @param string $current_url The URL used to invoke the application.
  * Extract the URL from your application's web
  * request framework and specify it here to have it checked
  * against the openid.current_url value in the response.  If
  * the current_url URL check fails, the status of the
  * completion will be FAILURE.
  *
  * @param array $query An array of the query parameters (key =>
  * value pairs) for this HTTP request.  Defaults to null.  If
  * null, the GET or POST data are automatically gotten from the
  * PHP environment.  It is only useful to override $query for
  * testing.
  *
  * @return Auth_OpenID_ConsumerResponse $response A instance of an
  * Auth_OpenID_ConsumerResponse subclass. The type of response is
  * indicated by the status attribute, which will be one of
  * SUCCESS, CANCEL, FAILURE, or SETUP_NEEDED.
  */
 function complete($current_url, $query = null)
 {
     if ($current_url && !is_string($current_url)) {
         // This is ugly, but we need to complain loudly when
         // someone uses the API incorrectly.
         trigger_error("current_url must be a string; see NEWS file " . "for upgrading notes.", E_USER_ERROR);
     }
     if ($query === null) {
         $query = Auth_OpenID::getQuery();
     }
     $loader = new Auth_OpenID_ServiceEndpointLoader();
     $endpoint_data = $this->session->get($this->_token_key);
     $endpoint = $loader->fromSession($endpoint_data);
     $message = Auth_OpenID_Message::fromPostArgs($query);
     $response = $this->consumer->complete($message, $endpoint, $current_url);
     $this->session->del($this->_token_key);
     if (in_array($response->status, array(Auth_OpenID_SUCCESS, Auth_OpenID_CANCEL))) {
         if ($response->identity_url !== null) {
             $disco = $this->getDiscoveryObject($this->session, $response->identity_url, $this->session_key_prefix);
             $disco->cleanup(true);
         }
     }
     return $response;
 }
开发者ID:raphox,项目名称:php-openid,代码行数:47,代码来源:Consumer.php

示例3: complete

 /**
  * Called to interpret the server's response to an OpenID
  * request. It is called in step 4 of the flow described in the
  * consumer overview.
  *
  * @param array $query An array of the query parameters (key =>
  * value pairs) for this HTTP request.
  *
  * @return Auth_OpenID_ConsumerResponse $response A instance of an
  * Auth_OpenID_ConsumerResponse subclass. The type of response is
  * indicated by the status attribute, which will be one of
  * SUCCESS, CANCEL, FAILURE, or SETUP_NEEDED.
  */
 function complete($query)
 {
     $query = Auth_OpenID::fixArgs($query);
     $loader = new Auth_OpenID_ServiceEndpointLoader();
     $endpoint_data = $this->session->get($this->_token_key);
     $endpoint = $loader->fromSession($endpoint_data);
     if ($endpoint === null) {
         $response = new Auth_OpenID_FailureResponse(null, 'No session state found');
     } else {
         $response = $this->consumer->complete($query, $endpoint);
         $this->session->del($this->_token_key);
     }
     if (in_array($response->status, array(Auth_OpenID_SUCCESS, Auth_OpenID_CANCEL))) {
         if ($response->identity_url !== null) {
             $disco = new Services_Yadis_Discovery($this->session, $response->identity_url, $this->session_key_prefix);
             $disco->cleanup();
         }
     }
     return $response;
 }
开发者ID:JJYing,项目名称:Anyway-Website,代码行数:33,代码来源:Consumer.php

示例4:

 function test_beginWithoutDiscovery()
 {
     // Does this really test anything non-trivial?
     $result = $this->consumer->beginWithoutDiscovery($this->endpoint);
     // The result is an auth request
     $this->assertTrue(strtolower(get_class($result)) == 'auth_openid_authrequest');
     $loader = new Auth_OpenID_ServiceEndpointLoader();
     // Side-effect of calling beginWithoutDiscovery is setting the
     // session value to the endpoint attribute of the result
     $this->assertTrue($loader->fromSession($this->session->get($this->consumer->_token_key)) == $result->endpoint);
     // The endpoint that we passed in is the endpoint on the
     // auth_request
     $this->assertTrue($result->endpoint == $this->endpoint);
 }
开发者ID:umbecr,项目名称:camilaframework,代码行数:14,代码来源:Consumer.php

示例5: complete

 /**
  * Called to interpret the server's response to an OpenID
  * request. It is called in step 4 of the flow described in the
  * consumer overview.
  *
  * @param string $current_url The URL used to invoke the application.
  * Extract the URL from your application's web
  * request framework and specify it here to have it checked
  * against the openid.current_url value in the response.  If
  * the current_url URL check fails, the status of the
  * completion will be FAILURE.
  *
  * @param array $query An array of the query parameters (key =>
  * value pairs) for this HTTP request.  Defaults to null.  If
  * null, the GET or POST data are automatically gotten from the
  * PHP environment.  It is only useful to override $query for
  * testing.
  *
  * @return Auth_OpenID_ConsumerResponse $response A instance of an
  * Auth_OpenID_ConsumerResponse subclass. The type of response is
  * indicated by the status attribute, which will be one of
  * SUCCESS, CANCEL, FAILURE, or SETUP_NEEDED.
  */
 function complete($current_url, $query = null)
 {
     if ($current_url && !is_string($current_url)) {
         // This is ugly, but we need to complain loudly when
         // someone uses the API incorrectly.
         trigger_error("current_url must be a string; see NEWS file " . "for upgrading notes.", E_USER_ERROR);
     }
     if ($query === null) {
         $query = Auth_OpenID::getQuery();
         if (empty($query)) {
             error_log('/lib/openid/Auth/OpenID/Consumer.php::complete() - warning: empty query string!');
             if (isset($_SERVER['HTTP_REFERER']) && ($argpos = strpos($_SERVER['HTTP_REFERER'], '?')) !== false) {
                 $query = Auth_OpenID::getQuery(substr($_SERVER['HTTP_REFERER'], $argpos + 1));
             }
         }
     }
     $loader = new Auth_OpenID_ServiceEndpointLoader();
     $endpoint_data = $this->session->get($this->_token_key);
     $endpoint = $loader->fromSession($endpoint_data);
     $message = Auth_OpenID_Message::fromPostArgs($query);
     $response = $this->consumer->complete($message, $endpoint, $current_url);
     $this->session->del($this->_token_key);
     if (in_array($response->status, array(Auth_OpenID_SUCCESS, Auth_OpenID_CANCEL))) {
         if ($response->identity_url !== null) {
             $disco = $this->getDiscoveryObject($this->session, $response->identity_url, $this->session_key_prefix);
             $disco->cleanup(true);
         }
     }
     return $response;
 }
开发者ID:remotelearner,项目名称:elis.openid,代码行数:53,代码来源:Consumer.php


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