routes.php 6.1 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#setEMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT'],
  53. ['name' => 'Users#setUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT'],
  54. ['name' => 'Users#stats', 'url' => '/settings/users/stats', 'verb' => 'GET'],
  55. ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST'],
  56. ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET'],
  57. ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET'],
  58. ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET'],
  59. ['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET'],
  60. ['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET'],
  61. ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST'],
  62. ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE'],
  63. ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST'],
  64. ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE'],
  65. ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server']],
  66. ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET'],
  67. ['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST'],
  68. ['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST'],
  69. ['name' => 'Personal#setLanguage', 'url' => '/settings/ajax/setlanguage.php', 'verb' => 'POST'],
  70. ]
  71. ]);
  72. /** @var $this \OCP\Route\IRouter */
  73. // Settings pages
  74. $this->create('settings_help', '/settings/help')
  75. ->actionInclude('settings/help.php');
  76. $this->create('settings_personal', '/settings/personal')
  77. ->actionInclude('settings/personal.php');
  78. $this->create('settings_users', '/settings/users')
  79. ->actionInclude('settings/users.php');
  80. // Settings ajax actions
  81. // users
  82. $this->create('settings_ajax_setquota', '/settings/ajax/setquota.php')
  83. ->actionInclude('settings/ajax/setquota.php');
  84. $this->create('settings_ajax_togglegroups', '/settings/ajax/togglegroups.php')
  85. ->actionInclude('settings/ajax/togglegroups.php');
  86. $this->create('settings_ajax_togglesubadmins', '/settings/ajax/togglesubadmins.php')
  87. ->actionInclude('settings/ajax/togglesubadmins.php');
  88. $this->create('settings_ajax_changegorupname', '/settings/ajax/changegroupname.php')
  89. ->actionInclude('settings/ajax/changegroupname.php');
  90. // apps
  91. $this->create('settings_ajax_enableapp', '/settings/ajax/enableapp.php')
  92. ->actionInclude('settings/ajax/enableapp.php');
  93. $this->create('settings_ajax_disableapp', '/settings/ajax/disableapp.php')
  94. ->actionInclude('settings/ajax/disableapp.php');
  95. $this->create('settings_ajax_updateapp', '/settings/ajax/updateapp.php')
  96. ->actionInclude('settings/ajax/updateapp.php');
  97. $this->create('settings_ajax_uninstallapp', '/settings/ajax/uninstallapp.php')
  98. ->actionInclude('settings/ajax/uninstallapp.php');
  99. $this->create('settings_ajax_navigationdetect', '/settings/ajax/navigationdetect.php')
  100. ->actionInclude('settings/ajax/navigationdetect.php');
  101. // admin
  102. $this->create('settings_ajax_excludegroups', '/settings/ajax/excludegroups.php')
  103. ->actionInclude('settings/ajax/excludegroups.php');