當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Hybrid_Endpoint::authInit方法代碼示例

本文整理匯總了PHP中Hybrid_Endpoint::authInit方法的典型用法代碼示例。如果您正苦於以下問題:PHP Hybrid_Endpoint::authInit方法的具體用法?PHP Hybrid_Endpoint::authInit怎麽用?PHP Hybrid_Endpoint::authInit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Hybrid_Endpoint的用法示例。


在下文中一共展示了Hybrid_Endpoint::authInit方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: processAuthDone

 /**
  * define:endpoint step 3.1 and 3.2
  */
 public static function processAuthDone()
 {
     Hybrid_Endpoint::authInit();
     // Fix a strange behavior when some provider call back ha endpoint
     // with /index.php?hauth.done={provider}?{args}...
     if (strrpos($_SERVER["QUERY_STRING"], '?')) {
         $_SERVER["QUERY_STRING"] = str_replace("?", "&", $_SERVER["QUERY_STRING"]);
         parse_str($_SERVER["QUERY_STRING"], Hybrid_Endpoint::$request);
     }
     $provider_id = trim(strip_tags(Hybrid_Endpoint::$request["hauth_done"]));
     $hauth = Hybrid_Auth::setup($provider_id);
     if (!$hauth) {
         Hybrid_Logger::error("Endpoint: Invalide parameter on hauth_done!");
         $hauth->adapter->setUserUnconnected();
         header("HTTP/1.0 404 Not Found");
         die("Invalide parameter! Please return to the login page and try again.");
     }
     try {
         Hybrid_Logger::info("Endpoint: call adapter [{$provider_id}] loginFinish() ");
         $hauth->adapter->loginFinish();
     } catch (Exception $e) {
         Hybrid_Logger::error("Exception:" . $e->getMessage(), $e);
         Hybrid_Error::setError($e->getMessage(), $e->getCode(), $e->getTraceAsString(), $e);
         $hauth->adapter->setUserUnconnected();
     }
     Hybrid_Logger::info("Endpoint: job done. retrun to callback url.");
     $hauth->returnToCallbackUrl();
     die;
 }
開發者ID:rwohleb,項目名稱:hybridauth,代碼行數:32,代碼來源:Endpoint.php

示例2: processAuthDone

 /**
  * define:endpoint step 3.1 and 3.2
  */
 public static function processAuthDone()
 {
     Hybrid_Endpoint::authInit();
     $provider_id = trim(strip_tags(Hybrid_Endpoint::$request["hauth_done"]));
     $hauth = Hybrid_Auth::setup($provider_id);
     if (!$hauth) {
         Hybrid_Logger::error("Endpoint: Invalide parameter on hauth_done!");
         $hauth->adapter->setUserUnconnected();
         header("HTTP/1.0 404 Not Found");
         die("Invalide parameter! Please return to the login page and try again.");
     }
     try {
         Hybrid_Logger::info("Endpoint: call adapter [{$provider_id}] loginFinish() ");
         $hauth->adapter->loginFinish();
     } catch (Exception $e) {
         Hybrid_Logger::error("Exception:" . $e->getMessage(), $e);
         Hybrid_Error::setError($e->getMessage(), $e->getCode(), $e->getTraceAsString(), $e);
         $hauth->adapter->setUserUnconnected();
     }
     Hybrid_Logger::info("Endpoint: job done. retrun to callback url.");
     $hauth->returnToCallbackUrl();
     die;
 }
開發者ID:a303,項目名稱:smart_lp2,代碼行數:26,代碼來源:Endpoint.php

示例3: processAuthDone

 /**
  * define:endpoint step 3.1 and 3.2
  */
 public static function processAuthDone()
 {
     Hybrid_Endpoint::authInit();
     $provider_id = trim(strip_tags(Hybrid_Endpoint::$request["hauth_done"]));
     # check if page accessed directly
     if (!Hybrid_Auth::storage()->get("hauth_session.{$provider_id}.hauth_endpoint")) {
         throw new Hybrid_Exception("You cannot access this page directly.");
     }
     $hauth = Hybrid_Auth::setup($provider_id);
     if (!$hauth) {
         $hauth->adapter->setUserUnconnected();
         throw new Hybrid_Exception("Invalid parameter! Please return to the login page and try again.");
     }
     try {
         $hauth->adapter->loginFinish();
     } catch (Exception $e) {
         Hybrid_Error::setError($e->getMessage(), $e->getCode());
         $hauth->adapter->setUserUnconnected();
     }
     $hauth->returnToCallbackUrl();
     die;
 }
開發者ID:designwall,項目名稱:dw-social-login,代碼行數:25,代碼來源:Endpoint.php


注:本文中的Hybrid_Endpoint::authInit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。