X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/4293cbe275bec99763c9fd4bd5df347bd359599f..ffa9d514d3a14c76170e26047f09009b4a6de07c:/www/login.php
diff --git a/www/login.php b/www/login.php
index a2cf97c..9c1b136 100644
--- a/www/login.php
+++ b/www/login.php
@@ -77,7 +77,7 @@ if (isset($_POST['openid_url'])) {
$authRequest->addExtension($ax);
$url = $authRequest->getAuthorizeURL();
-
+
header("Location: $url");
exit;
@@ -116,7 +116,7 @@ try {
} catch (OpenID_Exception $e) {
$status = "
Status: | EXCEPTION!";
$status .= " ({$e->getMessage()} : {$e->getCode()}) |
";
- }
+}
$openid = $message->getArrayFormat();
@@ -149,7 +149,11 @@ $name = isset($openid['openid.sreg.fullname']) && !isset($name)
$_SESSION['name'] = isset($name) ? $name : $_SERVER['REMOTE_ADDR'];
$_SESSION['identity'] = $openid['openid.identity'];
-$redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SESSION['REQUEST_URI'];
+if (isset($_SESSION['REQUEST_URI'])) {
+ $redirect = Tools::fullUrl($_SESSION['REQUEST_URI']);
+} else {
+ $redirect = Tools::fullUrl('/');
+}
header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
exit;
?>