當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。