upstream V3 development https://www.gnusocial.rocks/v3
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.
 
 
 
 
 
 

76 lines
2.9 KiB

  1. <?php
  2. declare(strict_types = 1);
  3. // {{{ License
  4. // This file is part of GNU social - https://www.gnu.org/software/social
  5. //
  6. // GNU social is free software: you can redistribute it and/or modify
  7. // it under the terms of the GNU Affero General Public License as published by
  8. // the Free Software Foundation, either version 3 of the License, or
  9. // (at your option) any later version.
  10. //
  11. // GNU social is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU Affero General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU Affero General Public License
  17. // along with GNU social. If not, see <http://www.gnu.org/licenses/>.
  18. // }}}
  19. /**
  20. * Define social's main routes
  21. *
  22. * @package GNUsocial
  23. * @category Router
  24. *
  25. * @author Hugo Sales <hugo@hsal.es>
  26. * @author Eliseu Amaro <mail@eliseuama.ro>
  27. * @author Diogo Cordeiro <mail@diogo.site>
  28. * @copyright 2020-2021 Free Software Foundation, Inc http://www.fsf.org
  29. * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
  30. */
  31. namespace App\Routes;
  32. use App\Controller as C;
  33. use App\Core\Router\RouteLoader;
  34. use Symfony\Bundle\FrameworkBundle\Controller\RedirectController;
  35. abstract class Main
  36. {
  37. public const LOAD_ORDER = 10;
  38. public static function load(RouteLoader $r): void
  39. {
  40. $r->connect('security_login', '/main/login', [C\Security::class, 'login']);
  41. $r->connect('security_logout', '/main/logout', [C\Security::class, 'logout']);
  42. $r->connect('security_register', '/main/register', [C\Security::class, 'register']);
  43. $r->connect('security_check_email', '/main/check-email', [C\ResetPassword::class, 'checkEmail']);
  44. $r->connect('security_recover_password', '/main/recover-password', [C\ResetPassword::class, 'requestPasswordReset']);
  45. $r->connect('security_recover_password_token', '/main/recover-password/{token?}', [C\ResetPassword::class, 'reset']);
  46. $r->connect('root', '/', RedirectController::class, ['defaults' => ['route' => 'feed_public']]);
  47. $r->connect('panel', '/panel', [C\AdminPanel::class, 'site']);
  48. $r->connect('panel_site', '/panel/site', [C\AdminPanel::class, 'site']);
  49. // TODO: don't do
  50. $r->connect('actor_circle', '/', RedirectController::class, ['defaults' => ['route' => 'feed_public']]);
  51. // FAQ static pages
  52. foreach (['faq', 'contact', 'tags', 'groups', 'openid'] as $s) {
  53. $r->connect('doc_' . $s, '/doc/' . $s, C\TemplateController::class, ['template' => 'doc/faq/' . $s . '.html.twig']);
  54. }
  55. foreach (['privacy', 'tos', 'version', 'source'] as $s) {
  56. $r->connect('doc_' . $s, '/doc/' . $s, C\TemplateController::class, ['template' => 'doc/' . $s . '.html.twig']);
  57. }
  58. $r->connect('settings', '/settings', [C\UserPanel::class, 'allSettings']);
  59. }
  60. }