userXrds.php 683 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. require_once "lib/session.php";
  3. require_once "lib/render.php";
  4. require_once "Auth/OpenID/Discover.php";
  5. define('user_xrds_pat', '<?xml version="1.0" encoding="UTF-8"?>
  6. <xrds:XRDS
  7. xmlns:xrds="xri://$xrds"
  8. xmlns="xri://$xrd*($v*2.0)">
  9. <XRD>
  10. <Service priority="0">
  11. <Type>%s</Type>
  12. <Type>%s</Type>
  13. <URI>%s</URI>
  14. </Service>
  15. </XRD>
  16. </xrds:XRDS>
  17. ');
  18. function userXrds_render($identity)
  19. {
  20. $headers = array('Content-type: application/xrds+xml');
  21. $body = sprintf(user_xrds_pat,
  22. Auth_OpenID_TYPE_2_0,
  23. Auth_OpenID_TYPE_1_1,
  24. buildURL());
  25. return array($headers, $body);
  26. }
  27. ?>