providers.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Frank Karlitschek <frank@karlitschek.de>
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Lukas Reschke <lukas@statuscode.ch>
  8. * @author Morris Jobke <hey@morrisjobke.de>
  9. * @author Roeland Jago Douma <roeland@famdouma.nl>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. require_once __DIR__ . '/../lib/versioncheck.php';
  27. require_once __DIR__ . '/../lib/base.php';
  28. header('Content-type: application/xml');
  29. $request = \OC::$server->getRequest();
  30. $url = $request->getServerProtocol() . '://' . substr($request->getServerHost() . $request->getRequestUri(), 0, -17).'ocs/v1.php/';
  31. $writer = new XMLWriter();
  32. $writer->openURI('php://output');
  33. $writer->startDocument('1.0', 'UTF-8');
  34. $writer->setIndent(true);
  35. $writer->startElement('providers');
  36. $writer->startElement('provider');
  37. $writer->writeElement('id', 'ownCloud');
  38. $writer->writeElement('location', $url);
  39. $writer->writeElement('name', 'ownCloud');
  40. $writer->writeElement('icon', '');
  41. $writer->writeElement('termsofuse', '');
  42. $writer->writeElement('register', '');
  43. $writer->startElement('services');
  44. $writer->startElement('config');
  45. $writer->writeAttribute('ocsversion', '1.7');
  46. $writer->endElement();
  47. $writer->startElement('activity');
  48. $writer->writeAttribute('ocsversion', '1.7');
  49. $writer->endElement();
  50. $writer->startElement('cloud');
  51. $writer->writeAttribute('ocsversion', '1.7');
  52. $writer->endElement();
  53. $writer->endElement();
  54. $writer->endElement();
  55. $writer->endDocument();
  56. $writer->flush();