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.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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\LostPassword\Application;
  9. $application = new Application();
  10. $application->registerRoutes($this, array('routes' => array(
  11. array('name' => 'lost#email', 'url' => '/lostpassword/email', 'verb' => 'POST'),
  12. array('name' => 'lost#resetform', 'url' => '/lostpassword/reset/form/{token}/{userId}', 'verb' => 'GET'),
  13. array('name' => 'lost#setPassword', 'url' => '/lostpassword/set/{token}/{userId}', 'verb' => 'POST'),
  14. )
  15. ));
  16. // Post installation check
  17. /** @var $this OCP\Route\IRouter */
  18. $this->create('post_setup_check', '/post-setup-check')
  19. ->action('OC_Setup', 'postSetupCheck');
  20. // Core ajax actions
  21. // Search
  22. $this->create('search_ajax_search', '/search/ajax/search.php')
  23. ->actionInclude('search/ajax/search.php');
  24. // AppConfig
  25. $this->create('core_ajax_appconfig', '/core/ajax/appconfig.php')
  26. ->actionInclude('core/ajax/appconfig.php');
  27. // Share
  28. $this->create('core_ajax_share', '/core/ajax/share.php')
  29. ->actionInclude('core/ajax/share.php');
  30. // Translations
  31. $this->create('core_ajax_translations', '/core/ajax/translations.php')
  32. ->actionInclude('core/ajax/translations.php');
  33. // Tags
  34. $this->create('core_tags_tags', '/tags/{type}')
  35. ->get()
  36. ->action('OC\Core\Tags\Controller', 'getTags')
  37. ->requirements(array('type'));
  38. $this->create('core_tags_favorites', '/tags/{type}/favorites')
  39. ->get()
  40. ->action('OC\Core\Tags\Controller', 'getFavorites')
  41. ->requirements(array('type'));
  42. $this->create('core_tags_ids_for_tag', '/tags/{type}/ids')
  43. ->get()
  44. ->action('OC\Core\Tags\Controller', 'getIdsForTag')
  45. ->requirements(array('type'));
  46. $this->create('core_tags_favorite', '/tags/{type}/favorite/{id}/')
  47. ->post()
  48. ->action('OC\Core\Tags\Controller', 'favorite')
  49. ->requirements(array('type', 'id'));
  50. $this->create('core_tags_unfavorite', '/tags/{type}/unfavorite/{id}/')
  51. ->post()
  52. ->action('OC\Core\Tags\Controller', 'unFavorite')
  53. ->requirements(array('type', 'id'));
  54. $this->create('core_tags_tag', '/tags/{type}/tag/{id}/')
  55. ->post()
  56. ->action('OC\Core\Tags\Controller', 'tagAs')
  57. ->requirements(array('type', 'id'));
  58. $this->create('core_tags_untag', '/tags/{type}/untag/{id}/')
  59. ->post()
  60. ->action('OC\Core\Tags\Controller', 'unTag')
  61. ->requirements(array('type', 'id'));
  62. $this->create('core_tags_add', '/tags/{type}/add')
  63. ->post()
  64. ->action('OC\Core\Tags\Controller', 'addTag')
  65. ->requirements(array('type'));
  66. $this->create('core_tags_delete', '/tags/{type}/delete')
  67. ->post()
  68. ->action('OC\Core\Tags\Controller', 'deleteTags')
  69. ->requirements(array('type'));
  70. // oC JS config
  71. $this->create('js_config', '/core/js/oc.js')
  72. ->actionInclude('core/js/config.php');
  73. // Routing
  74. $this->create('core_ajax_preview', '/core/preview')
  75. ->actionInclude('core/ajax/preview.php');
  76. $this->create('core_ajax_preview', '/core/preview.png')
  77. ->actionInclude('core/ajax/preview.php');
  78. // Avatar routes
  79. $this->create('core_avatar_get_tmp', '/avatar/tmp')
  80. ->get()
  81. ->action('OC\Core\Avatar\Controller', 'getTmpAvatar');
  82. $this->create('core_avatar_get', '/avatar/{user}/{size}')
  83. ->get()
  84. ->action('OC\Core\Avatar\Controller', 'getAvatar');
  85. $this->create('core_avatar_post', '/avatar/')
  86. ->post()
  87. ->action('OC\Core\Avatar\Controller', 'postAvatar');
  88. $this->create('core_avatar_delete', '/avatar/')
  89. ->delete()
  90. ->action('OC\Core\Avatar\Controller', 'deleteAvatar');
  91. $this->create('core_avatar_post_cropped', '/avatar/cropped')
  92. ->post()
  93. ->action('OC\Core\Avatar\Controller', 'postCroppedAvatar');
  94. // Not specifically routed
  95. $this->create('app_index_script', '/apps/{app}/')
  96. ->defaults(array('file' => 'index.php'))
  97. //->requirements(array('file' => '.*.php'))
  98. ->action('OC', 'loadAppScriptFile');
  99. $this->create('app_script', '/apps/{app}/{file}')
  100. ->defaults(array('file' => 'index.php'))
  101. ->requirements(array('file' => '.*.php'))
  102. ->action('OC', 'loadAppScriptFile');
  103. // used for heartbeat
  104. $this->create('heartbeat', '/heartbeat')->action(function(){
  105. // do nothing
  106. });