routes.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 Robin Appelman <icewind@owncloud.com>
  13. * @author Thomas Müller <thomas.mueller@tmit.eu>
  14. * @author Vincent Petry <pvince81@owncloud.com>
  15. *
  16. * @copyright Copyright (c) 2015, ownCloud, Inc.
  17. * @license AGPL-3.0
  18. *
  19. * This code is free software: you can redistribute it and/or modify
  20. * it under the terms of the GNU Affero General Public License, version 3,
  21. * as published by the Free Software Foundation.
  22. *
  23. * This program is distributed in the hope that it will be useful,
  24. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. * GNU Affero General Public License for more details.
  27. *
  28. * You should have received a copy of the GNU Affero General Public License, version 3,
  29. * along with this program. If not, see <http://www.gnu.org/licenses/>
  30. *
  31. */
  32. namespace OC\Settings;
  33. $application = new Application();
  34. $application->registerRoutes($this, array(
  35. 'resources' => array(
  36. 'groups' => array('url' => '/settings/users/groups'),
  37. 'users' => array('url' => '/settings/users/users')
  38. ),
  39. 'routes' => array(
  40. array('name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST'),
  41. array('name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST'),
  42. array('name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST'),
  43. array('name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET'),
  44. array('name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET'),
  45. array('name' => 'SecuritySettings#trustedDomains', 'url' => '/settings/admin/security/trustedDomains', 'verb' => 'POST'),
  46. array('name' => 'Users#setMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT'),
  47. array('name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST'),
  48. array('name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET'),
  49. array('name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET'),
  50. ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET'],
  51. )
  52. ));
  53. /** @var $this \OCP\Route\IRouter */
  54. // Settings pages
  55. $this->create('settings_help', '/settings/help')
  56. ->actionInclude('settings/help.php');
  57. $this->create('settings_personal', '/settings/personal')
  58. ->actionInclude('settings/personal.php');
  59. $this->create('settings_users', '/settings/users')
  60. ->actionInclude('settings/users.php');
  61. $this->create('settings_apps', '/settings/apps')
  62. ->actionInclude('settings/apps.php');
  63. $this->create('settings_admin', '/settings/admin')
  64. ->actionInclude('settings/admin.php');
  65. // Settings ajax actions
  66. // users
  67. $this->create('settings_ajax_everyonecount', '/settings/ajax/geteveryonecount')
  68. ->actionInclude('settings/ajax/geteveryonecount.php');
  69. $this->create('settings_ajax_setquota', '/settings/ajax/setquota.php')
  70. ->actionInclude('settings/ajax/setquota.php');
  71. $this->create('settings_ajax_togglegroups', '/settings/ajax/togglegroups.php')
  72. ->actionInclude('settings/ajax/togglegroups.php');
  73. $this->create('settings_ajax_togglesubadmins', '/settings/ajax/togglesubadmins.php')
  74. ->actionInclude('settings/ajax/togglesubadmins.php');
  75. $this->create('settings_users_changepassword', '/settings/users/changepassword')
  76. ->post()
  77. ->action('OC\Settings\ChangePassword\Controller', 'changeUserPassword');
  78. $this->create('settings_ajax_changedisplayname', '/settings/ajax/changedisplayname.php')
  79. ->actionInclude('settings/ajax/changedisplayname.php');
  80. $this->create('settings_ajax_changegorupname', '/settings/ajax/changegroupname.php')
  81. ->actionInclude('settings/ajax/changegroupname.php');
  82. // personal
  83. $this->create('settings_personal_changepassword', '/settings/personal/changepassword')
  84. ->post()
  85. ->action('OC\Settings\ChangePassword\Controller', 'changePersonalPassword');
  86. $this->create('settings_ajax_setlanguage', '/settings/ajax/setlanguage.php')
  87. ->actionInclude('settings/ajax/setlanguage.php');
  88. $this->create('settings_cert_post', '/settings/ajax/addRootCertificate')
  89. ->actionInclude('settings/ajax/addRootCertificate.php');
  90. $this->create('settings_cert_remove', '/settings/ajax/removeRootCertificate')
  91. ->actionInclude('settings/ajax/removeRootCertificate.php');
  92. // apps
  93. $this->create('settings_ajax_enableapp', '/settings/ajax/enableapp.php')
  94. ->actionInclude('settings/ajax/enableapp.php');
  95. $this->create('settings_ajax_disableapp', '/settings/ajax/disableapp.php')
  96. ->actionInclude('settings/ajax/disableapp.php');
  97. $this->create('settings_ajax_updateapp', '/settings/ajax/updateapp.php')
  98. ->actionInclude('settings/ajax/updateapp.php');
  99. $this->create('settings_ajax_uninstallapp', '/settings/ajax/uninstallapp.php')
  100. ->actionInclude('settings/ajax/uninstallapp.php');
  101. $this->create('settings_ajax_navigationdetect', '/settings/ajax/navigationdetect.php')
  102. ->actionInclude('settings/ajax/navigationdetect.php');
  103. // admin
  104. $this->create('settings_ajax_excludegroups', '/settings/ajax/excludegroups.php')
  105. ->actionInclude('settings/ajax/excludegroups.php');