<?php
-/**
- * OpenID
- *
- * PHP Version 5.2.0+
- *
- * @category Auth
- * @package OpenID
- * @author Bill Shupp <hostmaster@shupp.org>
- * @copyright 2009 Bill Shupp
- * @license http://www.opensource.org/licenses/bsd-license.php FreeBSD
- * @link http://github.com/shupp/openid
- */
namespace phorkie;
-// A tool for testing Relying Party functionality
-set_include_path(
- __DIR__ . '/../../src/'
- . PATH_SEPARATOR . get_include_path()
-);
-
$pageRequiresLogin = false;
require_once 'www-header.php';
-require_once 'openid/config.php';
-
if (isset($_REQUEST['logout'])) {
unset($_SESSION);
session_destroy();
- $redirect = 'http://' . $_SERVER['HTTP_HOST'];
- header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
- exit;
+ header('Location: ' . Tools::fullUrl('/'));
+ exit();
}
if (!count($_GET) && !count($_POST)) {
- render(
- 'login',
- null
- );
- exit;
+ render('login');
+ exit();
}
// Hackaround Non-Javascript Login Page
-if (!count($_POST) && isset($_GET['start'])) {
+if (!count($_POST) && isset($_GET['openid_url'])) {
$_POST = $_GET;
}
$openid_url = null;
}
+$realm = Tools::fullUrl('/');
+$returnTo = Tools::fullUrl('/login');
+
try {
$o = new \OpenID_RelyingParty($returnTo, $realm, $openid_url);
} catch (OpenID_Exception $e) {
$log = new \OpenID_Observer_Log;
\OpenID::attach($log);
-if (isset($_POST['start'])) {
+if (isset($_POST['openid_url'])) {
$_SESSION['openid_url'] = $openid_url;
try {