routes.php 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. // Post installation check
  9. $this->create('post_setup_check', '/post-setup-check')
  10. ->action('OC_Setup', 'postSetupCheck');
  11. // Core ajax actions
  12. // Search
  13. $this->create('search_ajax_search', '/search/ajax/search.php')
  14. ->actionInclude('search/ajax/search.php');
  15. // AppConfig
  16. $this->create('core_ajax_appconfig', '/core/ajax/appconfig.php')
  17. ->actionInclude('core/ajax/appconfig.php');
  18. // Share
  19. $this->create('core_ajax_share', '/core/ajax/share.php')
  20. ->actionInclude('core/ajax/share.php');
  21. // Translations
  22. $this->create('core_ajax_translations', '/core/ajax/translations.php')
  23. ->actionInclude('core/ajax/translations.php');
  24. // VCategories
  25. $this->create('core_ajax_vcategories_add', '/core/ajax/vcategories/add.php')
  26. ->actionInclude('core/ajax/vcategories/add.php');
  27. $this->create('core_ajax_vcategories_delete', '/core/ajax/vcategories/delete.php')
  28. ->actionInclude('core/ajax/vcategories/delete.php');
  29. $this->create('core_ajax_vcategories_addtofavorites', '/core/ajax/vcategories/addToFavorites.php')
  30. ->actionInclude('core/ajax/vcategories/addToFavorites.php');
  31. $this->create('core_ajax_vcategories_removefromfavorites', '/core/ajax/vcategories/removeFromFavorites.php')
  32. ->actionInclude('core/ajax/vcategories/removeFromFavorites.php');
  33. $this->create('core_ajax_vcategories_favorites', '/core/ajax/vcategories/favorites.php')
  34. ->actionInclude('core/ajax/vcategories/favorites.php');
  35. $this->create('core_ajax_vcategories_edit', '/core/ajax/vcategories/edit.php')
  36. ->actionInclude('core/ajax/vcategories/edit.php');
  37. // oC JS config
  38. $this->create('js_config', '/core/js/config.js')
  39. ->actionInclude('core/js/config.php');
  40. // Routing
  41. $this->create('core_ajax_routes', '/core/routes.json')
  42. ->action('OC_Router', 'JSRoutes');
  43. $this->create('core_ajax_preview', '/core/preview.png')
  44. ->actionInclude('core/ajax/preview.php');
  45. $this->create('core_lostpassword_index', '/lostpassword/')
  46. ->get()
  47. ->action('OC\Core\LostPassword\Controller', 'index');
  48. $this->create('core_lostpassword_send_email', '/lostpassword/')
  49. ->post()
  50. ->action('OC\Core\LostPassword\Controller', 'sendEmail');
  51. $this->create('core_lostpassword_reset', '/lostpassword/reset/{token}/{user}')
  52. ->get()
  53. ->action('OC\Core\LostPassword\Controller', 'reset');
  54. $this->create('core_lostpassword_reset_password', '/lostpassword/reset/{token}/{user}')
  55. ->post()
  56. ->action('OC\Core\LostPassword\Controller', 'resetPassword');
  57. // Avatar routes
  58. $this->create('core_avatar_get_tmp', '/avatar/tmp')
  59. ->get()
  60. ->action('OC\Core\Avatar\Controller', 'getTmpAvatar');
  61. $this->create('core_avatar_get', '/avatar/{user}/{size}')
  62. ->get()
  63. ->action('OC\Core\Avatar\Controller', 'getAvatar');
  64. $this->create('core_avatar_post', '/avatar/')
  65. ->post()
  66. ->action('OC\Core\Avatar\Controller', 'postAvatar');
  67. $this->create('core_avatar_delete', '/avatar/')
  68. ->delete()
  69. ->action('OC\Core\Avatar\Controller', 'deleteAvatar');
  70. $this->create('core_avatar_post_cropped', '/avatar/cropped')
  71. ->post()
  72. ->action('OC\Core\Avatar\Controller', 'postCroppedAvatar');
  73. // Not specifically routed
  74. $this->create('app_css', '/apps/{app}/{file}')
  75. ->requirements(array('file' => '.*.css'))
  76. ->action('OC', 'loadCSSFile');
  77. $this->create('app_index_script', '/apps/{app}/')
  78. ->defaults(array('file' => 'index.php'))
  79. //->requirements(array('file' => '.*.php'))
  80. ->action('OC', 'loadAppScriptFile');
  81. $this->create('app_script', '/apps/{app}/{file}')
  82. ->defaults(array('file' => 'index.php'))
  83. ->requirements(array('file' => '.*.php'))
  84. ->action('OC', 'loadAppScriptFile');
  85. // used for heartbeat
  86. $this->create('heartbeat', '/heartbeat')->action(function(){
  87. // do nothing
  88. });