providers.php 2.0 KB

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