routes.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. /**
  3. * @author Bart Visscher <bartv@thisnet.nl>
  4. * @author Björn Schießle <bjoern@schiessle.org>
  5. * @author Christoph Wurst <christoph@owncloud.com>
  6. * @author Christopher Schäpers <kondou@ts.unde.re>
  7. * @author Frank Karlitschek <frank@karlitschek.de>
  8. * @author Georg Ehrke <georg@owncloud.com>
  9. * @author Lukas Reschke <lukas@statuscode.ch>
  10. * @author Morris Jobke <hey@morrisjobke.de>
  11. * @author Raghu Nayyar <me@iraghu.com>
  12. * @author Robin Appelman <icewind@owncloud.com>
  13. * @author Roeland Jago Douma <rullzer@owncloud.com>
  14. * @author Thomas Müller <thomas.mueller@tmit.eu>
  15. * @author Vincent Petry <pvince81@owncloud.com>
  16. *
  17. * @copyright Copyright (c) 2016, ownCloud, Inc.
  18. * @license AGPL-3.0
  19. *
  20. * This code is free software: you can redistribute it and/or modify
  21. * it under the terms of the GNU Affero General Public License, version 3,
  22. * as published by the Free Software Foundation.
  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, version 3,
  30. * along with this program. If not, see <http://www.gnu.org/licenses/>
  31. *
  32. */
  33. namespace OC\Settings;
  34. $application = new Application();
  35. $application->registerRoutes($this, [
  36. 'resources' => [
  37. 'groups' => ['url' => '/settings/users/groups'],
  38. 'users' => ['url' => '/settings/users/users'],
  39. 'AuthSettings' => ['url' => '/settings/personal/authtokens'],
  40. ],
  41. 'routes' => [
  42. ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST'],
  43. ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST'],
  44. ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST'],
  45. ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST'],
  46. ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET'],
  47. ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET'],
  48. ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET'],
  49. ['name' => 'AppSettings#changeExperimentalConfigState', 'url' => '/settings/apps/experimental', 'verb' => 'POST'],
  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. ]
  65. ]);
  66. /** @var $this \OCP\Route\IRouter */
  67. // Settings pages
  68. $this->create('settings_help', '/settings/help')
  69. ->actionInclude('settings/help.php');
  70. $this->create('settings_personal', '/settings/personal')
  71. ->actionInclude('settings/personal.php');
  72. $this->create('settings_users', '/settings/users')
  73. ->actionInclude('settings/users.php');
  74. $this->create('settings_admin', '/settings/admin')
  75. ->actionInclude('settings/admin.php');
  76. // Settings ajax actions
  77. // users
  78. $this->create('settings_ajax_setquota', '/settings/ajax/setquota.php')
  79. ->actionInclude('settings/ajax/setquota.php');
  80. $this->create('settings_ajax_togglegroups', '/settings/ajax/togglegroups.php')
  81. ->actionInclude('settings/ajax/togglegroups.php');
  82. $this->create('settings_ajax_togglesubadmins', '/settings/ajax/togglesubadmins.php')
  83. ->actionInclude('settings/ajax/togglesubadmins.php');
  84. $this->create('settings_users_changepassword', '/settings/users/changepassword')
  85. ->post()
  86. ->action('OC\Settings\ChangePassword\Controller', 'changeUserPassword');
  87. $this->create('settings_ajax_changegorupname', '/settings/ajax/changegroupname.php')
  88. ->actionInclude('settings/ajax/changegroupname.php');
  89. // personal
  90. $this->create('settings_personal_changepassword', '/settings/personal/changepassword')
  91. ->post()
  92. ->action('OC\Settings\ChangePassword\Controller', 'changePersonalPassword');
  93. $this->create('settings_ajax_setlanguage', '/settings/ajax/setlanguage.php')
  94. ->actionInclude('settings/ajax/setlanguage.php');
  95. // apps
  96. $this->create('settings_ajax_enableapp', '/settings/ajax/enableapp.php')
  97. ->actionInclude('settings/ajax/enableapp.php');
  98. $this->create('settings_ajax_disableapp', '/settings/ajax/disableapp.php')
  99. ->actionInclude('settings/ajax/disableapp.php');
  100. $this->create('settings_ajax_updateapp', '/settings/ajax/updateapp.php')
  101. ->actionInclude('settings/ajax/updateapp.php');
  102. $this->create('settings_ajax_uninstallapp', '/settings/ajax/uninstallapp.php')
  103. ->actionInclude('settings/ajax/uninstallapp.php');
  104. $this->create('settings_ajax_navigationdetect', '/settings/ajax/navigationdetect.php')
  105. ->actionInclude('settings/ajax/navigationdetect.php');
  106. // admin
  107. $this->create('settings_ajax_excludegroups', '/settings/ajax/excludegroups.php')
  108. ->actionInclude('settings/ajax/excludegroups.php');