// Each user has only one identity to choose from
// So we can make automatically the identity selection
if ($request->idSelect()) {
- $request->identity = get_user_openid_url($user);
+ $request->identity = $user->hruid();
}
// If we still don't have an identifier (used or desired), give up
$user = S::user();
// Check that the identity matches the user currently logged in
- if ($request->identity != get_user_openid_url($user)) {
+ if ($request->identity != $user->hruid) {
$response =& $request->answer(false);
$webresponse =& $server->encodeResponse($response);
$this->render_openid_response($webresponse);
// Load constants
$this->load('openid.inc.php');
+ // Make sure the user exists
+ $user = get_user($x);
+ if (is_null($user)) {
+ return PL_NOT_FOUND;
+ }
+
// Set XRDS content-type and template
header('Content-type: application/xrds+xml');
$page->changeTpl('openid/user_xrds.tpl', NO_SKIN);
// Set variables
- $page->assign('type1', Auth_OpenID_TYPE_2_0);
- $page->assign('type2', Auth_OpenID_TYPE_1_1);
- $page->assign('uri', get_openid_url());
+ $page->assign('type2', Auth_OpenID_TYPE_2_0);
+ $page->assign('type1', Auth_OpenID_TYPE_1_1);
+ $page->assign('provider', get_openid_url());
+ $page->assign('local_id', $user->hruid);
}
function handler_melix(&$page, $x = null)
<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS
xmlns:xrds="xri://$xrds"
- xmlns="xri://$xrd*($v*2.0)">
+ xmlns="xri://$xrd*($v*2.0)"
+ xmlns:openid="http://openid.net/xmlns/1.0">
<XRD>
- <Service priority="0">
+ <Service priority="10">
<Type>{$type2}</Type>
+ <URI>{$provider}</URI>
+ <LocalID>{$local_id}</LocalID>
+ </Service>
+ <Service priority="20">
<Type>{$type1}</Type>
- <URI>{$uri}</URI>
+ <URI>{$provider}</URI>
+ <openid:Delegate>{$local_id}</openid:Delegate>
</Service>
</XRD>
-</xrds:XRDS>
\ No newline at end of file
+</xrds:XRDS>