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


PHP Hybrid_Auth::getCurrentUrl方法代碼示例

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


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

示例1: processOpenidRealm

 /**
  * Process OpenID realm request
  */
 public static function processOpenidRealm()
 {
     $output = str_replace("{X_XRDS_LOCATION}", htmlentities(Hybrid_Auth::getCurrentUrl(false), ENT_QUOTES, 'UTF-8') . "?get=openid_xrds&v=" . Hybrid_Auth::$version, file_get_contents(dirname(__FILE__) . "/resources/openid_realm.html"));
     print $output;
     @session_write_close();
     die;
 }
開發者ID:govza,項目名稱:modx-hybridauth,代碼行數:10,代碼來源:Endpoint.php

示例2: processOpenidRealm

 /**
  * Process OpenID realm request
  */
 public static function processOpenidRealm()
 {
     print '<pre>';
     print_r(Hybrid_Auth::$config);
     exit;
     $output = str_replace("{X_XRDS_LOCATION}", htmlentities(Hybrid_Auth::getCurrentUrl(false), ENT_QUOTES, 'UTF-8') . "?get=openid_xrds&v=" . Hybrid_Auth::$version, file_get_contents(Hybrid_Auth::$config['path_Hybrid'] . "resources/openid_realm.html"));
     print $output;
     die;
 }
開發者ID:Tramp1357,項目名稱:atlasorg,代碼行數:12,代碼來源:hybrid_endpoint.class.php

示例3: setup

 /**
  * Setup an adapter for a given provider
  */
 public static function setup($providerId, $params = NULL)
 {
     Hybrid_Logger::debug("Enter Hybrid_Auth::setup( {$providerId} )", $params);
     if (!$params) {
         $params = Hybrid_Auth::storage()->get("hauth_session.{$providerId}.id_provider_params");
         Hybrid_Logger::debug("Hybrid_Auth::setup( {$providerId} ), no params given. Trying to get the sotred for this provider.", $params);
     }
     if (!$params) {
         $params = array();
         Hybrid_Logger::info("Hybrid_Auth::setup( {$providerId} ), no stored params found for this provider. Initialize a new one for new session");
     }
     if (!isset($params["hauth_return_to"])) {
         $params["hauth_return_to"] = Hybrid_Auth::getCurrentUrl();
     }
     Hybrid_Logger::debug("Hybrid_Auth::setup( {$providerId} ). HybridAuth Callback URL set to: ", $params["hauth_return_to"]);
     # instantiate a new IDProvider Adapter
     $provider = new Hybrid_Provider_Adapter();
     $provider->factory($providerId, $params);
     return $provider;
 }
開發者ID:OneataBogdan,項目名稱:lead_coriolan,代碼行數:23,代碼來源:Auth.php

示例4: str_replace

        // 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"], $_REQUEST);
        }
        $provider_id = trim(strip_tags($_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;
    }
} else {
    # Else,
    # We advertise our XRDS document, something supposed to be done from the Realm URL page
    echo str_replace("{X_XRDS_LOCATION}", Hybrid_Auth::getCurrentUrl(false) . "?get=openid_xrds&v=" . Hybrid_Auth::$version, file_get_contents(dirname(__FILE__) . "/Hybrid/resources/openid_realm.html"));
    die;
}
開發者ID:rijojoy,項目名稱:MyIceBerg,代碼行數:31,代碼來源:index.php

示例5: processOpenidRealm

 /**
  * Process OpenID realm request
  */
 public static function processOpenidRealm()
 {
     $output = str_replace("{X_XRDS_LOCATION}", Hybrid_Auth::getCurrentUrl(false) . "?get=openid_xrds&v=" . Hybrid_Auth::$version, file_get_contents(dirname(__FILE__) . "/resources/openid_realm.html"));
     print $output;
     die;
 }
開發者ID:rwohleb,項目名稱:hybridauth,代碼行數:9,代碼來源:Endpoint.php

示例6: processOpenidRealm

 /**
  * Process OpenID realm request
  */
 protected function processOpenidRealm()
 {
     $template = '<html> 
         <head>
     		<title>HybridAuth Endpoint</title>
     		<meta name="robots" content="NOINDEX, NOFOLLOW">
     		<meta http-equiv="X-XRDS-Location" content="{X_XRDS_LOCATION}" />
     	</head>
     	<body>
     		<h3 style="margin-bottom: 2px;">HybridAuth</h3> 
     		Open Source Social Sign On PHP Library. 
     		<br />
     		<a href="http://hybridauth.sourceforge.net/" style="color:green;text-decoration:none;">hybridauth.sourceforge.net/</a> 
     	</body>
     </html>
     ';
     $output = str_replace("{X_XRDS_LOCATION}", htmlentities(Hybrid_Auth::getCurrentUrl(false), ENT_QUOTES, 'UTF-8') . "?get=openid_xrds&v=" . Hybrid_Auth::$version, $template);
     return $output;
 }
開發者ID:Tramp1357,項目名稱:atlasorg,代碼行數:22,代碼來源:endpoint.class.php

示例7: setup

 /**
  * Setup an adapter for a given provider
  */
 public static function setup($providerId, $params = NULL)
 {
     if (!$params) {
         $params = Hybrid_Auth::storage()->get("hauth_session.{$providerId}.id_provider_params");
     }
     if (!$params) {
         $params = array();
     }
     if (is_array($params) && !isset($params["hauth_return_to"])) {
         $params["hauth_return_to"] = Hybrid_Auth::getCurrentUrl();
     }
     # instantiate a new IDProvider Adapter
     $provider = new Hybrid_Provider_Adapter();
     $provider->factory($providerId, $params);
     return $provider;
 }
開發者ID:Vatia13,項目名稱:dancesport,代碼行數:19,代碼來源:Auth.php

示例8: wsl_component_tools_do_diagnostics


//.........這裏部分代碼省略.........
										<p>Class LightOpenID is auto-included by another plugin.</p>
										<p>This is not critical but it may prevent Yahoo, Steam, and few other providers from working.</p>
										<p>Please, inform the developer of that plugin not to auto-include the file below and to use Class LightOpenID only when required.</p> 
										<div style="background-color: #FFFFE0;border:1px solid #E6DB55; border-radius: 3px;padding: 10px;margin:2px;">
										<?php 
        try {
            $reflector = new ReflectionClass('LightOpenID');
            echo $reflector->getFileName();
        } catch (Exception $e) {
        }
        ?>
										</div>
									</div>
								<?php 
    }
    ?>
					</td>
					<td>
						<?php 
    if ($test) {
        echo "<b style='color:green;'>OK!</b>";
    } else {
        echo "<b style='color:orange;'>PASS</b>";
    }
    ?>
					</td>
				</tr>

				<?php 
    $curl = '';
    $test = true;
    if (!class_exists('Hybrid_Auth', false)) {
        include_once WORDPRESS_SOCIAL_LOGIN_ABS_PATH . "/hybridauth/Hybrid/Auth.php";
        $curl = Hybrid_Auth::getCurrentUrl();
    }
    $headers = array('HTTP_VIA', 'HTTP_X_FORWARDED_FOR', 'HTTP_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED', 'HTTP_CLIENT_IP', 'HTTP_FORWARDED_FOR_IP', 'VIA', 'X_FORWARDED_FOR', 'FORWARDED_FOR', 'X_FORWARDED', 'FORWARDED', 'CLIENT_IP', 'FORWARDED_FOR_IP', 'HTTP_PROXY_CONNECTION');
    foreach ($headers as $v) {
        if (isset($_SERVER[$v])) {
            $test = true;
        }
    }
    ?>
				<tr>
					<th width="200">
						<label>HTTP Proxies</label>
					</th>
					<td>
						<p>Check for proxified urls.</p>
						<?php 
    if (!$test) {
        ?>
									<div class="fade error" style="margin: 20px  0;"> 
										<p>WSL has detected that you are using a proxy in your website. The URL shown below should match the URL on your browser address bar.</p>
										<div style="background-color: #FFFFE0;border:1px solid #E6DB55; border-radius: 3px;padding: 10px;margin:2px;">
											<?php 
        echo $curl;
        ?>
										</div>
									</div>
								<?php 
    }
    ?>
					</td>
					<td>
						<?php 
    if ($test) {
開發者ID:sdh100shaun,項目名稱:pantheon,代碼行數:67,代碼來源:wsl.components.tools.actions.job.php

示例9: login

 /**
  * Hybrid_Provider_Adapter::login(), prepare the user session and the authentication request
  * for index.php
  */
 function login()
 {
     if (!$this->adapter) {
         throw new Exception("Hybrid_Provider_Adapter::login() should not directly used.");
     }
     // clear all unneeded params
     foreach (Hybrid_Auth::$config["providers"] as $idpid => $params) {
         Hybrid_Auth::storage()->delete("hauth_session.{$idpid}.hauth_return_to");
         Hybrid_Auth::storage()->delete("hauth_session.{$idpid}.hauth_endpoint");
         Hybrid_Auth::storage()->delete("hauth_session.{$idpid}.id_provider_params");
     }
     // make a fresh start
     $this->logout();
     # get hybridauth base url
     if (empty(Hybrid_Auth::$config["base_url"])) {
         $HYBRID_AUTH_URL_BASE = Hybrid_Auth::getCurrentUrl(true);
     } else {
         $HYBRID_AUTH_URL_BASE = Hybrid_Auth::$config["base_url"];
     }
     // make sure params is array
     if (!is_array($this->params)) {
         $this->params = array();
     }
     # we make use of session_id() as storage hash to identify the current user
     # using session_regenerate_id() will be a problem, but ..
     $this->params["hauth_token"] = session_id();
     # set request timestamp
     $this->params["hauth_time"] = time();
     # for default HybridAuth endpoint url hauth_login_start_url
     # 	auth.start  required  the IDp ID
     # 	auth.time   optional  login request timestamp
     $this->params["login_start"] = $HYBRID_AUTH_URL_BASE . (strpos($HYBRID_AUTH_URL_BASE, '?') ? '&' : '?') . "hauth.start={$this->id}&hauth.time={$this->params["hauth_time"]}";
     # for default HybridAuth endpoint url hauth_login_done_url
     # 	auth.done   required  the IDp ID
     $this->params["login_done"] = $HYBRID_AUTH_URL_BASE . (strpos($HYBRID_AUTH_URL_BASE, '?') ? '&' : '?') . "hauth.done={$this->id}";
     if (isset($this->config["endpoint"])) {
         $this->params["login_start"] = $this->config["endpoint"] . (strpos($HYBRID_AUTH_URL_BASE, '?') ? '&' : '?') . "hauth.start={$this->id}&hauth.time={$this->params["hauth_time"]}";
         $this->params["login_done"] = $this->config["endpoint"];
     }
     if (isset($this->params["hauth_return_to"])) {
         Hybrid_Auth::storage()->set("hauth_session.{$this->id}.hauth_return_to", $this->params["hauth_return_to"]);
     }
     if (isset($this->params["login_done"])) {
         Hybrid_Auth::storage()->set("hauth_session.{$this->id}.hauth_endpoint", $this->params["login_done"]);
     }
     Hybrid_Auth::storage()->set("hauth_session.{$this->id}.id_provider_params", $this->params);
     // store config to be used by the end point
     Hybrid_Auth::storage()->config("CONFIG", Hybrid_Auth::$config);
     Hybrid_Auth::redirect($this->params["login_start"]);
 }
開發者ID:designwall,項目名稱:dw-social-login,代碼行數:54,代碼來源:Provider_Adapter.php


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