diff options
author | tailor <cygnus@janrain.com> | 2007-04-06 17:54:30 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2007-04-06 17:54:30 +0000 |
commit | 44f369a8f26d28e7a1233573c1ab86518129b7d1 (patch) | |
tree | e656564e29e6ee9292da7459b81a6a7eb78de21e /examples/server/lib/render/userXrds.php | |
parent | 14af87b5db19c4ca2fd9a3d2f5b8ea37e13c8fd0 (diff) | |
download | php-openid-44f369a8f26d28e7a1233573c1ab86518129b7d1.zip php-openid-44f369a8f26d28e7a1233573c1ab86518129b7d1.tar.gz php-openid-44f369a8f26d28e7a1233573c1ab86518129b7d1.tar.bz2 |
[project @ Add user-specific XRDS rendering]
Diffstat (limited to 'examples/server/lib/render/userXrds.php')
-rw-r--r-- | examples/server/lib/render/userXrds.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/examples/server/lib/render/userXrds.php b/examples/server/lib/render/userXrds.php new file mode 100644 index 0000000..d38d894 --- /dev/null +++ b/examples/server/lib/render/userXrds.php @@ -0,0 +1,34 @@ +<?php + +require_once "lib/session.php"; +require_once "lib/render.php"; + +require_once "Auth/OpenID/Discover.php"; + +define('user_xrds_pat', '<?xml version="1.0" encoding="UTF-8"?> +<xrds:XRDS + xmlns:xrds="xri://$xrds" + xmlns="xri://$xrd*($v*2.0)"> + <XRD> + <Service priority="0"> + <Type>%s</Type> + <Type>%s</Type> + <URI>%s</URI> + </Service> + </XRD> +</xrds:XRDS> +'); + +function userXrds_render($identity) +{ + $headers = array('Content-type: application/xrds+xml'); + + $body = sprintf(xrds_pat, + Auth_OpenID_TYPE_2_0, + Auth_OpenID_TYPE_1_1, + buildURL()); + + return array($headers, $body); +} + +?>
\ No newline at end of file |