本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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) {
示例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"]);
}