2016-07-18 16:39:37 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
Route::pattern('username', '[a-zA-Z0-9_]{1,20}');
|
|
|
|
Route::pattern('id', '[1-9][0-9]{0,9}');
|
|
|
|
Route::pattern('contest_id', '[1-9][0-9]{0,9}');
|
2022-10-17 12:42:32 +00:00
|
|
|
Route::pattern('list_id', '[1-9][0-9]{0,9}');
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::pattern('tab', '\S{1,20}');
|
|
|
|
Route::pattern('rand_str_id', '[0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]{20}');
|
2022-10-12 13:10:07 +00:00
|
|
|
Route::pattern('image_name', '[0-9a-z]{1,20}');
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::pattern('upgrade_name', '[a-zA-Z0-9_]{1,50}');
|
|
|
|
|
2022-11-06 02:26:21 +00:00
|
|
|
Route::group(
|
|
|
|
[
|
|
|
|
'domain' => '(' . UOJConfig::$data['web']['main']['host'] . '|127.0.0.1' . ')'
|
|
|
|
],
|
|
|
|
function () {
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::any('/', '/index.php');
|
|
|
|
Route::any('/problems', '/problem_set.php');
|
|
|
|
Route::any('/problems/template', '/problem_set.php?tab=template');
|
2023-01-18 08:20:12 +00:00
|
|
|
Route::any('/problems/new/remote', '/new_remote_problem.php');
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::any('/problem/{id}', '/problem.php');
|
2022-09-28 11:48:49 +00:00
|
|
|
Route::any('/problem/{id}/solutions', '/problem_solutions.php');
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::any('/problem/{id}/statistics', '/problem_statistics.php');
|
|
|
|
Route::any('/problem/{id}/manage/statement', '/problem_statement_manage.php');
|
|
|
|
Route::any('/problem/{id}/manage/managers', '/problem_managers_manage.php');
|
|
|
|
Route::any('/problem/{id}/manage/data', '/problem_data_manage.php');
|
2022-11-06 02:26:21 +00:00
|
|
|
Route::any('/download/problem/{id}/data.zip', '/download.php?type=problem');
|
|
|
|
Route::any('/download/problem/{id}/attachment.zip', '/download.php?type=attachment');
|
2022-09-18 11:34:17 +00:00
|
|
|
|
2022-10-22 11:24:48 +00:00
|
|
|
Route::any('/lists', '/lists.php');
|
|
|
|
Route::any('/list/{id}', '/list.php');
|
2022-11-10 00:16:48 +00:00
|
|
|
Route::any('/list/{id}/manage(?:/{tab})?', '/list_manage.php');
|
2022-11-06 02:26:21 +00:00
|
|
|
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::any('/contests', '/contests.php');
|
|
|
|
Route::any('/contest/new', '/add_contest.php');
|
|
|
|
Route::any('/contest/{id}', '/contest_inside.php');
|
|
|
|
Route::any('/contest/{id}/registrants', '/contest_members.php');
|
|
|
|
Route::any('/contest/{id}/register', '/contest_registration.php');
|
2022-10-23 12:39:11 +00:00
|
|
|
Route::any('/contest/{id}/confirm', '/contest_confirmation.php');
|
|
|
|
Route::any('/contest/{id}/manage(?:/{tab})?', '/contest_manage.php');
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::any('/contest/{id}/submissions', '/contest_inside.php?tab=submissions');
|
|
|
|
Route::any('/contest/{id}/standings', '/contest_inside.php?tab=standings');
|
2022-04-13 08:23:24 +00:00
|
|
|
Route::any('/contest/{id}/after_contest_standings', '/contest_inside.php?tab=after_contest_standings');
|
2022-09-19 11:27:57 +00:00
|
|
|
Route::any('/contest/{id}/self_reviews', '/contest_inside.php?tab=self_reviews');
|
2018-07-09 02:40:30 +00:00
|
|
|
Route::any('/contest/{id}/backstage', '/contest_inside.php?tab=backstage');
|
2022-11-06 02:26:21 +00:00
|
|
|
Route::any('/contest/{id}/standings_unfrozen', '/contest_inside.php?tab=standings_unfrozen');
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::any('/contest/{contest_id}/problem/{id}', '/problem.php');
|
|
|
|
Route::any('/contest/{contest_id}/problem/{id}/statistics', '/problem_statistics.php');
|
2022-11-06 02:26:21 +00:00
|
|
|
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::any('/submissions', '/submissions_list.php');
|
|
|
|
Route::any('/submission/{id}', '/submission.php');
|
|
|
|
Route::any('/submission-status-details', '/submission_status_details.php');
|
2022-11-06 02:26:21 +00:00
|
|
|
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::any('/hacks', '/hack_list.php');
|
|
|
|
Route::any('/hack/{id}', '/hack.php');
|
2022-03-20 00:07:46 +00:00
|
|
|
|
|
|
|
Route::any('/groups', '/groups.php');
|
|
|
|
Route::any('/group/{id}', '/group.php');
|
2022-10-21 12:42:48 +00:00
|
|
|
Route::any('/group/{id}/manage(?:/{tab})?', '/group_manage.php');
|
2022-10-17 12:42:32 +00:00
|
|
|
Route::any('/group/{id}/assignment/{list_id}', '/group_assignment.php');
|
2022-11-06 02:26:21 +00:00
|
|
|
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::any('/blogs', '/blogs.php');
|
2019-07-12 06:30:00 +00:00
|
|
|
if (UOJConfig::$data['switch']['blog-domain-mode'] != 3) {
|
style(web): change link location of blog functions
When using sub-directory blog, the 'blogof' not looks so good.
And, there are duplicate 'blog' characters, which making people uncomfortable.
So, for sub-directory blog, use 'blog' instead of 'blogof'.
'blog' is not as a sub folder or type anymore, use 'post' instead.
BREAKING CHANGE: Due to the conflict of 'blog' sub-directory, when go to blog post,
now should use 'blogs/{id}'; but when subdomain mode is on, you can still use 'blog'
to access these blog posts. 'blogof' is no longer used, and you need to inform users
that blog link is changed, to avoid the inaccessbility.
2019-07-12 04:13:30 +00:00
|
|
|
Route::any('/blog/{id}', '/blog_show.php');
|
|
|
|
}
|
|
|
|
Route::any('/blogs/{id}', '/blog_show.php');
|
|
|
|
Route::any('/post/{id}', '/blog_show.php');
|
2022-10-20 09:07:43 +00:00
|
|
|
Route::any('/post/{id}/write', '/blog_show.php?sub=%2Fwrite');
|
2022-11-06 02:26:21 +00:00
|
|
|
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::any('/announcements', '/announcements.php');
|
2022-11-06 02:26:21 +00:00
|
|
|
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::any('/faq', '/faq.php');
|
2022-03-21 02:51:31 +00:00
|
|
|
Route::any('/solverlist', '/ranklist.php?type=accepted');
|
2022-11-06 02:26:21 +00:00
|
|
|
|
2022-03-14 13:49:48 +00:00
|
|
|
Route::any('/captcha', '/captcha.php');
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::any('/login', '/login.php');
|
|
|
|
Route::any('/logout', '/logout.php');
|
|
|
|
Route::any('/register', '/register.php');
|
|
|
|
Route::any('/forgot-password', '/forgot_pw.php');
|
|
|
|
Route::any('/reset-password', '/reset_pw.php');
|
2022-10-17 14:13:08 +00:00
|
|
|
|
|
|
|
Route::any('/user/{username}', '/user_info.php');
|
2022-10-19 13:59:16 +00:00
|
|
|
Route::any('/user/{username}/edit(?:/{tab})?', '/user_info_edit.php');
|
2022-10-17 14:13:08 +00:00
|
|
|
Route::any('/user_msg', '/user_msg.php');
|
|
|
|
Route::any('/user/{username}/system_msg', '/user_system_msg.php');
|
|
|
|
|
2022-10-20 09:07:43 +00:00
|
|
|
Route::any('/super_manage(?:/{tab})?', '/super_manage.php');
|
2022-11-06 02:26:21 +00:00
|
|
|
|
|
|
|
Route::any('/check-notice', '/check_notice.php');
|
2016-07-18 16:39:37 +00:00
|
|
|
Route::any('/click-zan', '/click_zan.php');
|
2022-10-12 12:35:23 +00:00
|
|
|
|
2022-10-14 23:07:45 +00:00
|
|
|
// Apps
|
2023-01-08 05:57:39 +00:00
|
|
|
Route::any('/image_hosting', '/app/image_hosting/index.php');
|
|
|
|
Route::get('/image_hosting/{image_name}.png', '/app/image_hosting/get_image.php');
|
|
|
|
Route::any('/html2markdown', '/app/html2markdown.php');
|
2016-07-18 16:39:37 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Route::post('/judge/submit', '/judge/submit.php');
|
|
|
|
Route::post('/judge/sync-judge-client', '/judge/sync_judge_client.php');
|
|
|
|
|
2022-11-06 02:26:21 +00:00
|
|
|
Route::post('/judge/download/submission/{id}/{rand_str_id}', '/download.php?type=submission&auth=judger');
|
|
|
|
Route::post('/judge/download/tmp/{rand_str_id}', '/download.php?type=tmp&auth=judger');
|
|
|
|
Route::post('/judge/download/problem/{id}', '/download.php?type=problem&auth=judger');
|