git.cweiske.de
/
phorkie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rename "secureAtLevel" variable since it does not define a level at all
[phorkie.git]
/
www
/
login.php
diff --git
a/www/login.php
b/www/login.php
index a2cf97c211ebcaa69fc5fe5fa85b927ffa9da9c6..a97246f3f7a3b5ee946fbfd112798e7fe6de6448 100644
(file)
--- a/
www/login.php
+++ b/
www/login.php
@@
-34,11
+34,7
@@
$returnTo = Tools::fullUrl('/login');
try {
$o = new \OpenID_RelyingParty($returnTo, $realm, $openid_url);
} catch (OpenID_Exception $e) {
try {
$o = new \OpenID_RelyingParty($returnTo, $realm, $openid_url);
} catch (OpenID_Exception $e) {
- $contents = "<div class='openid_results'>\n";
- $contents .= "<pre>" . $e->getMessage() . "</pre>\n";
- $contents .= "</div class='openid_results'>";
- include_once 'openid/wrapper.php';
- exit;
+ throw new Exception($e->getMessage());
}
if (!empty($_POST['disable_associations']) || !empty($_SESSION['disable_associations'])) {
}
if (!empty($_POST['disable_associations']) || !empty($_SESSION['disable_associations'])) {
@@
-55,11
+51,7
@@
if (isset($_POST['openid_url'])) {
try {
$authRequest = $o->prepare();
} catch (OpenID_Exception $e) {
try {
$authRequest = $o->prepare();
} catch (OpenID_Exception $e) {
- $contents = "<div class='openid_results'>\n";
- $contents .= "<pre>" . $e->getMessage() . "</pre>\n";
- $contents .= "</div class='openid_results'>";
- include_once 'openid/wrapper.php';
- exit;
+ throw new Exception($e->getMessage());
}
// SREG
}
// SREG
@@
-77,7
+69,7
@@
if (isset($_POST['openid_url'])) {
$authRequest->addExtension($ax);
$url = $authRequest->getAuthorizeURL();
$authRequest->addExtension($ax);
$url = $authRequest->getAuthorizeURL();
-
+
header("Location: $url");
exit;
header("Location: $url");
exit;
@@
-116,7
+108,7
@@
try {
} catch (OpenID_Exception $e) {
$status = "<tr><td>Status:</td><td><font color='red'>EXCEPTION!";
$status .= " ({$e->getMessage()} : {$e->getCode()})</font></td></tr>";
} catch (OpenID_Exception $e) {
$status = "<tr><td>Status:</td><td><font color='red'>EXCEPTION!";
$status .= " ({$e->getMessage()} : {$e->getCode()})</font></td></tr>";
-
}
+}
$openid = $message->getArrayFormat();
$openid = $message->getArrayFormat();
@@
-149,7
+141,11
@@
$name = isset($openid['openid.sreg.fullname']) && !isset($name)
$_SESSION['name'] = isset($name) ? $name : $_SERVER['REMOTE_ADDR'];
$_SESSION['identity'] = $openid['openid.identity'];
$_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;
?>
header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
exit;
?>