You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

routes.php 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. /**
  3. * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. use OC\Core\Application;
  9. $application = new Application();
  10. $application->registerRoutes($this, [
  11. 'routes' => [
  12. ['name' => 'lost#email', 'url' => '/lostpassword/email', 'verb' => 'POST'],
  13. ['name' => 'lost#resetform', 'url' => '/lostpassword/reset/form/{token}/{userId}', 'verb' => 'GET'],
  14. ['name' => 'lost#setPassword', 'url' => '/lostpassword/set/{token}/{userId}', 'verb' => 'POST'],
  15. ['name' => 'user#getDisplayNames', 'url' => '/displaynames', 'verb' => 'POST'],
  16. ['name' => 'avatar#getAvatar', 'url' => '/avatar/{userId}/{size}', 'verb' => 'GET'],
  17. ['name' => 'avatar#deleteAvatar', 'url' => '/avatar/', 'verb' => 'DELETE'],
  18. ['name' => 'avatar#postCroppedAvatar', 'url' => '/avatar/cropped', 'verb' => 'POST'],
  19. ['name' => 'avatar#getTmpAvatar', 'url' => '/avatar/tmp', 'verb' => 'GET'],
  20. ['name' => 'avatar#postAvatar', 'url' => '/avatar/', 'verb' => 'POST'],
  21. ]
  22. ]);
  23. // Post installation check
  24. /** @var $this OCP\Route\IRouter */
  25. // Core ajax actions
  26. // Search
  27. $this->create('search_ajax_search', '/core/search')
  28. ->actionInclude('core/search/ajax/search.php');
  29. // AppConfig
  30. $this->create('core_ajax_appconfig', '/core/ajax/appconfig.php')
  31. ->actionInclude('core/ajax/appconfig.php');
  32. // Share
  33. $this->create('core_ajax_share', '/core/ajax/share.php')
  34. ->actionInclude('core/ajax/share.php');
  35. // Tags
  36. $this->create('core_tags_tags', '/tags/{type}')
  37. ->get()
  38. ->action('OC\Core\Tags\Controller', 'getTags')
  39. ->requirements(array('type'));
  40. $this->create('core_tags_favorites', '/tags/{type}/favorites')
  41. ->get()
  42. ->action('OC\Core\Tags\Controller', 'getFavorites')
  43. ->requirements(array('type'));
  44. $this->create('core_tags_ids_for_tag', '/tags/{type}/ids')
  45. ->get()
  46. ->action('OC\Core\Tags\Controller', 'getIdsForTag')
  47. ->requirements(array('type'));
  48. $this->create('core_tags_favorite', '/tags/{type}/favorite/{id}/')
  49. ->post()
  50. ->action('OC\Core\Tags\Controller', 'favorite')
  51. ->requirements(array('type', 'id'));
  52. $this->create('core_tags_unfavorite', '/tags/{type}/unfavorite/{id}/')
  53. ->post()
  54. ->action('OC\Core\Tags\Controller', 'unFavorite')
  55. ->requirements(array('type', 'id'));
  56. $this->create('core_tags_tag', '/tags/{type}/tag/{id}/')
  57. ->post()
  58. ->action('OC\Core\Tags\Controller', 'tagAs')
  59. ->requirements(array('type', 'id'));
  60. $this->create('core_tags_untag', '/tags/{type}/untag/{id}/')
  61. ->post()
  62. ->action('OC\Core\Tags\Controller', 'unTag')
  63. ->requirements(array('type', 'id'));
  64. $this->create('core_tags_add', '/tags/{type}/add')
  65. ->post()
  66. ->action('OC\Core\Tags\Controller', 'addTag')
  67. ->requirements(array('type'));
  68. $this->create('core_tags_delete', '/tags/{type}/delete')
  69. ->post()
  70. ->action('OC\Core\Tags\Controller', 'deleteTags')
  71. ->requirements(array('type'));
  72. // oC JS config
  73. $this->create('js_config', '/core/js/oc.js')
  74. ->actionInclude('core/js/config.php');
  75. // Routing
  76. $this->create('core_ajax_preview', '/core/preview')
  77. ->actionInclude('core/ajax/preview.php');
  78. $this->create('core_ajax_preview', '/core/preview.png')
  79. ->actionInclude('core/ajax/preview.php');
  80. $this->create('core_ajax_update', '/core/ajax/update.php')
  81. ->actionInclude('core/ajax/update.php');
  82. // Sharing routes
  83. $this->create('files_sharing.sharecontroller.showShare', '/s/{token}')->action(function($urlParams) {
  84. $app = new \OCA\Files_Sharing\Application($urlParams);
  85. $app->dispatch('ShareController', 'showShare');
  86. });
  87. $this->create('files_sharing.sharecontroller.authenticate', '/s/{token}/authenticate')->post()->action(function($urlParams) {
  88. $app = new \OCA\Files_Sharing\Application($urlParams);
  89. $app->dispatch('ShareController', 'authenticate');
  90. });
  91. $this->create('files_sharing.sharecontroller.showAuthenticate', '/s/{token}/authenticate')->get()->action(function($urlParams) {
  92. $app = new \OCA\Files_Sharing\Application($urlParams);
  93. $app->dispatch('ShareController', 'showAuthenticate');
  94. });
  95. $this->create('files_sharing.sharecontroller.downloadShare', '/s/{token}/download')->get()->action(function($urlParams) {
  96. $app = new \OCA\Files_Sharing\Application($urlParams);
  97. $app->dispatch('ShareController', 'downloadShare');
  98. });
  99. // used for heartbeat
  100. $this->create('heartbeat', '/heartbeat')->action(function(){
  101. // do nothing
  102. });