2018-08-25 21:16:20 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use FastRoute\RouteCollector;
|
|
|
|
|
|
|
|
/** @var RouteCollector $route */
|
|
|
|
|
2018-12-18 02:23:44 +01:00
|
|
|
// Pages
|
2019-06-13 15:18:47 +02:00
|
|
|
$route->get('/', 'HomeController@index');
|
2018-09-02 02:13:18 +02:00
|
|
|
$route->get('/credits', 'CreditsController@index');
|
2020-09-01 00:27:29 +02:00
|
|
|
$route->get('/health', 'HealthController@index');
|
2018-12-18 02:23:44 +01:00
|
|
|
|
2018-10-25 18:53:05 +02:00
|
|
|
// Authentication
|
2018-11-27 12:01:36 +01:00
|
|
|
$route->get('/login', 'AuthController@login');
|
|
|
|
$route->post('/login', 'AuthController@postLogin');
|
2018-10-25 18:53:05 +02:00
|
|
|
$route->get('/logout', 'AuthController@logout');
|
|
|
|
|
2020-11-15 18:47:30 +01:00
|
|
|
// OAuth
|
2020-12-26 16:09:39 +01:00
|
|
|
$route->get('/oauth/{provider}', 'OAuthController@index');
|
|
|
|
$route->post('/oauth/{provider}/connect', 'OAuthController@connect');
|
|
|
|
$route->post('/oauth/{provider}/disconnect', 'OAuthController@disconnect');
|
2020-11-15 18:47:30 +01:00
|
|
|
|
|
|
|
// User settings
|
2022-10-03 18:58:04 +02:00
|
|
|
$route->get('/settings/profile', 'SettingsController@profile');
|
|
|
|
$route->post('/settings/profile', 'SettingsController@saveProfile');
|
2020-11-23 20:41:02 +01:00
|
|
|
$route->get('/settings/password', 'SettingsController@password');
|
|
|
|
$route->post('/settings/password', 'SettingsController@savePassword');
|
2022-06-07 21:33:08 +02:00
|
|
|
$route->get('/settings/theme', 'SettingsController@theme');
|
|
|
|
$route->post('/settings/theme', 'SettingsController@saveTheme');
|
2022-06-20 19:03:47 +02:00
|
|
|
$route->get('/settings/language', 'SettingsController@language');
|
|
|
|
$route->post('/settings/language', 'SettingsController@saveLanguage');
|
2020-11-15 18:47:30 +01:00
|
|
|
$route->get('/settings/oauth', 'SettingsController@oauth');
|
|
|
|
|
2019-10-08 16:17:06 +02:00
|
|
|
// Password recovery
|
|
|
|
$route->get('/password/reset', 'PasswordResetController@reset');
|
|
|
|
$route->post('/password/reset', 'PasswordResetController@postReset');
|
|
|
|
$route->get('/password/reset/{token:.+}', 'PasswordResetController@resetPassword');
|
|
|
|
$route->post('/password/reset/{token:.+}', 'PasswordResetController@postResetPassword');
|
|
|
|
|
2018-12-18 02:23:44 +01:00
|
|
|
// Stats
|
|
|
|
$route->get('/metrics', 'Metrics\\Controller@metrics');
|
|
|
|
$route->get('/stats', 'Metrics\\Controller@stats');
|
2018-11-20 18:55:56 +01:00
|
|
|
|
2020-04-05 16:54:45 +02:00
|
|
|
// News
|
|
|
|
$route->get('/news', 'NewsController@index');
|
|
|
|
$route->get('/meetings', 'NewsController@meetings');
|
|
|
|
$route->get('/news/{id:\d+}', 'NewsController@show');
|
|
|
|
$route->post('/news/{id:\d+}', 'NewsController@comment');
|
2021-07-14 01:56:03 +02:00
|
|
|
$route->post('/news/comment/{id:\d+}', 'NewsController@deleteComment');
|
2020-04-05 16:54:45 +02:00
|
|
|
|
2020-12-06 00:16:15 +01:00
|
|
|
// FAQ
|
|
|
|
$route->get('/faq', 'FaqController@index');
|
|
|
|
|
2020-12-18 18:27:10 +01:00
|
|
|
// Questions
|
|
|
|
$route->get('/questions', 'QuestionsController@index');
|
|
|
|
$route->post('/questions', 'QuestionsController@delete');
|
|
|
|
$route->get('/questions/new', 'QuestionsController@add');
|
|
|
|
$route->post('/questions/new', 'QuestionsController@save');
|
|
|
|
|
2022-04-09 19:08:53 +02:00
|
|
|
// Messages
|
|
|
|
$route->get('/messages', 'MessagesController@index');
|
2022-06-04 17:55:26 +02:00
|
|
|
$route->post('/messages', 'MessagesController@redirectToConversation');
|
|
|
|
$route->get('/messages/{user_id:\d+}', 'MessagesController@messagesOfConversation');
|
2022-04-09 19:08:53 +02:00
|
|
|
$route->post('/messages/{user_id:\d+}', 'MessagesController@send');
|
|
|
|
$route->post('/messages/{user_id:\d+}/{msg_id:\d+}', 'MessagesController@delete');
|
|
|
|
|
2018-11-20 18:55:56 +01:00
|
|
|
// API
|
|
|
|
$route->get('/api[/{resource:.+}]', 'ApiController@index');
|
2019-11-27 23:43:21 +01:00
|
|
|
|
2020-04-24 18:08:09 +02:00
|
|
|
// Design
|
|
|
|
$route->get('/design', 'DesignController@index');
|
|
|
|
|
2019-11-27 23:43:21 +01:00
|
|
|
// Administration
|
|
|
|
$route->addGroup(
|
|
|
|
'/admin',
|
|
|
|
function (RouteCollector $route) {
|
2020-12-06 00:16:15 +01:00
|
|
|
// FAQ
|
|
|
|
$route->addGroup(
|
|
|
|
'/faq',
|
|
|
|
function (RouteCollector $route) {
|
|
|
|
$route->get('[/{id:\d+}]', 'Admin\\FaqController@edit');
|
|
|
|
$route->post('[/{id:\d+}]', 'Admin\\FaqController@save');
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2020-05-01 16:29:28 +02:00
|
|
|
// Log
|
|
|
|
$route->get('/logs', 'Admin\\LogsController@index');
|
|
|
|
$route->post('/logs', 'Admin\\LogsController@index');
|
|
|
|
|
2019-11-27 23:43:21 +01:00
|
|
|
// Schedule
|
|
|
|
$route->addGroup(
|
2020-04-07 15:08:49 +02:00
|
|
|
'/schedule',
|
2019-11-27 23:43:21 +01:00
|
|
|
function (RouteCollector $route) {
|
|
|
|
$route->get('', 'Admin\\Schedule\\ImportSchedule@index');
|
2020-11-21 20:54:04 +01:00
|
|
|
$route->get('/edit[/{id:\d+}]', 'Admin\\Schedule\\ImportSchedule@edit');
|
|
|
|
$route->post('/edit[/{id:\d+}]', 'Admin\\Schedule\\ImportSchedule@save');
|
|
|
|
$route->get('/load/{id:\d+}', 'Admin\\Schedule\\ImportSchedule@loadSchedule');
|
|
|
|
$route->post('/import/{id:\d+}', 'Admin\\Schedule\\ImportSchedule@importSchedule');
|
2019-11-27 23:43:21 +01:00
|
|
|
}
|
|
|
|
);
|
2020-05-01 16:29:28 +02:00
|
|
|
|
2020-12-18 18:27:10 +01:00
|
|
|
// Questions
|
|
|
|
$route->addGroup(
|
|
|
|
'/questions',
|
|
|
|
function (RouteCollector $route) {
|
|
|
|
$route->get('', 'Admin\\QuestionsController@index');
|
|
|
|
$route->post('', 'Admin\\QuestionsController@delete');
|
|
|
|
$route->get('/{id:\d+}', 'Admin\\QuestionsController@edit');
|
|
|
|
$route->post('/{id:\d+}', 'Admin\\QuestionsController@save');
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2021-09-24 20:28:51 +02:00
|
|
|
// User
|
|
|
|
$route->addGroup(
|
|
|
|
'/user/{id:\d+}',
|
|
|
|
// Shirts
|
|
|
|
function (RouteCollector $route) {
|
|
|
|
$route->get('/shirt', 'Admin\\UserShirtController@editShirt');
|
|
|
|
$route->post('/shirt', 'Admin\\UserShirtController@saveShirt');
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2020-05-01 16:29:28 +02:00
|
|
|
// News
|
2020-04-05 16:54:45 +02:00
|
|
|
$route->addGroup(
|
|
|
|
'/news',
|
|
|
|
function (RouteCollector $route) {
|
|
|
|
$route->get('[/{id:\d+}]', 'Admin\\NewsController@edit');
|
|
|
|
$route->post('[/{id:\d+}]', 'Admin\\NewsController@save');
|
|
|
|
}
|
|
|
|
);
|
2019-11-27 23:43:21 +01:00
|
|
|
}
|
|
|
|
);
|