routes.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bart Visscher <bartv@thisnet.nl>
  6. * @author Björn Schießle <bjoern@schiessle.org>
  7. * @author Christopher Schäpers <kondou@ts.unde.re>
  8. * @author Christoph Wurst <christoph@owncloud.com>
  9. * @author Frank Karlitschek <frank@karlitschek.de>
  10. * @author Georg Ehrke <georg@owncloud.com>
  11. * @author Lukas Reschke <lukas@statuscode.ch>
  12. * @author Morris Jobke <hey@morrisjobke.de>
  13. * @author Raghu Nayyar <me@iraghu.com>
  14. * @author Robin Appelman <robin@icewind.nl>
  15. * @author Roeland Jago Douma <roeland@famdouma.nl>
  16. * @author Thomas Müller <thomas.mueller@tmit.eu>
  17. * @author Vincent Petry <pvince81@owncloud.com>
  18. *
  19. * @license AGPL-3.0
  20. *
  21. * This code is free software: you can redistribute it and/or modify
  22. * it under the terms of the GNU Affero General Public License, version 3,
  23. * as published by the Free Software Foundation.
  24. *
  25. * This program is distributed in the hope that it will be useful,
  26. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  27. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28. * GNU Affero General Public License for more details.
  29. *
  30. * You should have received a copy of the GNU Affero General Public License, version 3,
  31. * along with this program. If not, see <http://www.gnu.org/licenses/>
  32. *
  33. */
  34. namespace OC\Settings;
  35. $application = new Application();
  36. $application->registerRoutes($this, [
  37. 'resources' => [
  38. 'groups' => ['url' => '/settings/users/groups'],
  39. 'users' => ['url' => '/settings/users/users'],
  40. 'AuthSettings' => ['url' => '/settings/personal/authtokens'],
  41. ],
  42. 'routes' => [
  43. ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST'],
  44. ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST'],
  45. ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST'],
  46. ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST'],
  47. ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET'],
  48. ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET'],
  49. ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET'],
  50. ['name' => 'SecuritySettings#trustedDomains', 'url' => '/settings/admin/security/trustedDomains', 'verb' => 'POST'],
  51. ['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST'],
  52. ['name' => 'Users#setMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT'],
  53. ['name' => 'Users#stats', 'url' => '/settings/users/stats', 'verb' => 'GET'],
  54. ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST'],
  55. ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET'],
  56. ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET'],
  57. ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET'],
  58. ['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET'],
  59. ['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET'],
  60. ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST'],
  61. ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE'],
  62. ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST'],
  63. ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE'],
  64. ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server']],
  65. ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET'],
  66. ['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST'],
  67. ['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST'],
  68. ['name' => 'Personal#setLanguage', 'url' => '/settings/ajax/setlanguage.php', 'verb' => 'POST'],
  69. ]
  70. ]);
  71. /** @var $this \OCP\Route\IRouter */
  72. // Settings pages
  73. $this->create('settings_help', '/settings/help')
  74. ->actionInclude('settings/help.php');
  75. $this->create('settings_personal', '/settings/personal')
  76. ->actionInclude('settings/personal.php');
  77. $this->create('settings_users', '/settings/users')
  78. ->actionInclude('settings/users.php');
  79. // Settings ajax actions
  80. // users
  81. $this->create('settings_ajax_setquota', '/settings/ajax/setquota.php')
  82. ->actionInclude('settings/ajax/setquota.php');
  83. $this->create('settings_ajax_togglegroups', '/settings/ajax/togglegroups.php')
  84. ->actionInclude('settings/ajax/togglegroups.php');
  85. $this->create('settings_ajax_togglesubadmins', '/settings/ajax/togglesubadmins.php')
  86. ->actionInclude('settings/ajax/togglesubadmins.php');
  87. $this->create('settings_ajax_changegorupname', '/settings/ajax/changegroupname.php')
  88. ->actionInclude('settings/ajax/changegroupname.php');
  89. // apps
  90. $this->create('settings_ajax_enableapp', '/settings/ajax/enableapp.php')
  91. ->actionInclude('settings/ajax/enableapp.php');
  92. $this->create('settings_ajax_disableapp', '/settings/ajax/disableapp.php')
  93. ->actionInclude('settings/ajax/disableapp.php');
  94. $this->create('settings_ajax_updateapp', '/settings/ajax/updateapp.php')
  95. ->actionInclude('settings/ajax/updateapp.php');
  96. $this->create('settings_ajax_uninstallapp', '/settings/ajax/uninstallapp.php')
  97. ->actionInclude('settings/ajax/uninstallapp.php');
  98. $this->create('settings_ajax_navigationdetect', '/settings/ajax/navigationdetect.php')
  99. ->actionInclude('settings/ajax/navigationdetect.php');
  100. // admin
  101. $this->create('settings_ajax_excludegroups', '/settings/ajax/excludegroups.php')
  102. ->actionInclude('settings/ajax/excludegroups.php');