return array(
'openid' => $this->make_hook('openid', AUTH_PUBLIC),
'openid/trust' => $this->make_hook('trust', AUTH_COOKIE),
+ 'openid/idp_xrds' => $this->make_hook('idp_xrds', AUTH_PUBLIC),
'openid/user_xrds' => $this->make_hook('user_xrds', AUTH_PUBLIC),
'openid/melix' => $this->make_hook('melix', AUTH_PUBLIC),
);
$this->render_openid_response($webresponse);
}
+ function handler_idp_xrds(&$page)
+ {
+ // Load constants
+ $this->load('openid.inc.php');
+
+ // Set XRDS content-type and template
+ header('Content-type: application/xrds+xml');
+ $page->changeTpl('openid/idp_xrds.tpl', NO_SKIN);
+
+ // Set variables
+ $page->assign('type2', Auth_OpenID_TYPE_2_0_IDP);
+ $page->assign('sreg', Auth_OpenID_SREG_URI);
+ $page->assign('provider', get_openid_url());
+ }
+
function handler_user_xrds(&$page, $x = null)
{
// Load constants
return $globals->baseurl . '/openid/' . $user->hruid;
}
+function get_idp_xrds_url()
+{
+ global $globals;
+ return $globals->baseurl . '/openid/idp_xrds';
+}
+
function get_user_xrds_url($user)
{
if (is_null($user)) {
function handler_index(&$page)
{
+ global $globals;
+
+ // Include X-XRDS-Location response-header for Yadis discovery
+ header('X-XRDS-Location: ' . $globals->baseurl . '/openid/idp_xrds');
+
+ // Redirect to the suitable page
if (S::logged()) {
pl_redirect('events');
} else if (!@$GLOBALS['IS_XNET_SITE']) {
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<xrds:XRDS
+ xmlns:xrds="xri://$xrds"
+ xmlns="xri://$xrd*($v*2.0)"
+ xmlns:openid="http://openid.net/xmlns/1.0">
+ <XRD>
+ <Service>
+ <Type>{$type2}</Type>
+ <Type>{$sreg}</Type>
+ <URI>{$provider}</URI>
+ </Service>
+ </XRD>
+</xrds:XRDS>