routes.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. /**
  3. * @author Bart Visscher <bartv@thisnet.nl>
  4. * @author Björn Schießle <schiessle@owncloud.com>
  5. * @author Christopher Schäpers <kondou@ts.unde.re>
  6. * @author Clark Tomlinson <fallen013@gmail.com>
  7. * @author Frank Karlitschek <frank@owncloud.org>
  8. * @author Georg Ehrke <georg@owncloud.com>
  9. * @author Lukas Reschke <lukas@owncloud.com>
  10. * @author Morris Jobke <hey@morrisjobke.de>
  11. * @author Raghu Nayyar <me@iraghu.com>
  12. * @author Thomas Müller <thomas.mueller@tmit.eu>
  13. *
  14. * @copyright Copyright (c) 2015, ownCloud, Inc.
  15. * @license AGPL-3.0
  16. *
  17. * This code is free software: you can redistribute it and/or modify
  18. * it under the terms of the GNU Affero General Public License, version 3,
  19. * as published by the Free Software Foundation.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU Affero General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU Affero General Public License, version 3,
  27. * along with this program. If not, see <http://www.gnu.org/licenses/>
  28. *
  29. */
  30. namespace OC\Settings;
  31. $application = new Application();
  32. $application->registerRoutes($this, [
  33. 'resources' => [
  34. 'groups' => ['url' => '/settings/users/groups'],
  35. 'users' => ['url' => '/settings/users/users']
  36. ],
  37. 'routes' => [
  38. ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST'],
  39. ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST'],
  40. ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST'],
  41. ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST'],
  42. ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET'],
  43. ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET'],
  44. ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET'],
  45. ['name' => 'AppSettings#changeExperimentalConfigState', 'url' => '/settings/apps/experimental', 'verb' => 'POST'],
  46. ['name' => 'SecuritySettings#trustedDomains', 'url' => '/settings/admin/security/trustedDomains', 'verb' => 'POST'],
  47. ['name' => 'Users#setMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT'],
  48. ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST'],
  49. ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET'],
  50. ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET'],
  51. ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET'],
  52. ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST'],
  53. ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE'],
  54. ]
  55. ]);
  56. /** @var $this \OCP\Route\IRouter */
  57. // Settings pages
  58. $this->create('settings_help', '/settings/help')
  59. ->actionInclude('settings/help.php');
  60. $this->create('settings_personal', '/settings/personal')
  61. ->actionInclude('settings/personal.php');
  62. $this->create('settings_users', '/settings/users')
  63. ->actionInclude('settings/users.php');
  64. $this->create('settings_admin', '/settings/admin')
  65. ->actionInclude('settings/admin.php');
  66. // Settings ajax actions
  67. // users
  68. $this->create('settings_ajax_everyonecount', '/settings/ajax/geteveryonecount')
  69. ->actionInclude('settings/ajax/geteveryonecount.php');
  70. $this->create('settings_ajax_setquota', '/settings/ajax/setquota.php')
  71. ->actionInclude('settings/ajax/setquota.php');
  72. $this->create('settings_ajax_togglegroups', '/settings/ajax/togglegroups.php')
  73. ->actionInclude('settings/ajax/togglegroups.php');
  74. $this->create('settings_ajax_togglesubadmins', '/settings/ajax/togglesubadmins.php')
  75. ->actionInclude('settings/ajax/togglesubadmins.php');
  76. $this->create('settings_users_changepassword', '/settings/users/changepassword')
  77. ->post()
  78. ->action('OC\Settings\ChangePassword\Controller', 'changeUserPassword');
  79. $this->create('settings_ajax_changedisplayname', '/settings/ajax/changedisplayname.php')
  80. ->actionInclude('settings/ajax/changedisplayname.php');
  81. $this->create('settings_ajax_changegorupname', '/settings/ajax/changegroupname.php')
  82. ->actionInclude('settings/ajax/changegroupname.php');
  83. // personal
  84. $this->create('settings_personal_changepassword', '/settings/personal/changepassword')
  85. ->post()
  86. ->action('OC\Settings\ChangePassword\Controller', 'changePersonalPassword');
  87. $this->create('settings_ajax_setlanguage', '/settings/ajax/setlanguage.php')
  88. ->actionInclude('settings/ajax/setlanguage.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');