publicxrds.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /**
  3. * Public XRDS for OpenID
  4. *
  5. * PHP version 5
  6. *
  7. * @category Action
  8. * @package StatusNet
  9. * @author Evan Prodromou <evan@status.net>
  10. * @author Craig Andrews <candrews@integralblue.com>
  11. * @author Robin Millette <millette@status.net>
  12. * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
  13. * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  14. * @link http://status.net/
  15. *
  16. * StatusNet - the distributed open-source microblogging tool
  17. * Copyright (C) 2008, 2009, StatusNet, Inc.
  18. *
  19. * This program is free software: you can redistribute it and/or modify
  20. * it under the terms of the GNU Affero General Public License as published by
  21. * the Free Software Foundation, either version 3 of the License, or
  22. * (at your option) any later version.
  23. *
  24. * This program is distributed in the hope that it will be useful,
  25. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. * GNU Affero General Public License for more details.
  28. *
  29. * You should have received a copy of the GNU Affero General Public License
  30. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  31. */
  32. if (!defined('STATUSNET') && !defined('LACONICA')) {
  33. exit(1);
  34. }
  35. require_once INSTALLDIR.'/plugins/OpenID/openid.php';
  36. require_once INSTALLDIR.'/lib/xrdsoutputter.php';
  37. /**
  38. * Public XRDS
  39. *
  40. * @category Action
  41. * @package StatusNet
  42. * @author Evan Prodromou <evan@status.net>
  43. * @author Robin Millette <millette@status.net>
  44. * @author Craig Andrews <candrews@integralblue.com>
  45. * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
  46. * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  47. * @link http://status.net/
  48. *
  49. * @todo factor out similarities with XrdsAction
  50. */
  51. class PublicxrdsAction extends Action
  52. {
  53. /**
  54. * Is read only?
  55. *
  56. * @return boolean true
  57. */
  58. function isReadOnly($args)
  59. {
  60. return true;
  61. }
  62. /**
  63. * Class handler.
  64. *
  65. * @param array $args array of arguments
  66. *
  67. * @return nothing
  68. */
  69. function handle($args)
  70. {
  71. parent::handle($args);
  72. $xrdsOutputter = new XRDSOutputter();
  73. $xrdsOutputter->startXRDS();
  74. Event::handle('StartPublicXRDS', array($this,&$xrdsOutputter));
  75. Event::handle('EndPublicXRDS', array($this,&$xrdsOutputter));
  76. $xrdsOutputter->endXRDS();
  77. }
  78. }