xref: /webtrees/app/Http/Routes/WebRoutes.php (revision ddb44b4cf356ab8fd0c5d21becf3fce4c4e46244)
1<?php
2
3/**
4 * webtrees: online genealogy
5 * Copyright (C) 2019 webtrees development team
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU 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 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18declare(strict_types=1);
19
20namespace Fisharebest\Webtrees\Http\Routes;
21
22use Aura\Router\Map;
23use Fig\Http\Message\RequestMethodInterface;
24use Fisharebest\Webtrees\Http\Middleware\AuthAdministrator;
25use Fisharebest\Webtrees\Http\Middleware\AuthEditor;
26use Fisharebest\Webtrees\Http\Middleware\AuthLoggedIn;
27use Fisharebest\Webtrees\Http\Middleware\AuthManager;
28use Fisharebest\Webtrees\Http\Middleware\AuthModerator;
29use Fisharebest\Webtrees\Http\RequestHandlers\AccountDelete;
30use Fisharebest\Webtrees\Http\RequestHandlers\AccountEdit;
31use Fisharebest\Webtrees\Http\RequestHandlers\AccountUpdate;
32use Fisharebest\Webtrees\Http\RequestHandlers\AddChildToFamilyAction;
33use Fisharebest\Webtrees\Http\RequestHandlers\AddChildToFamilyPage;
34use Fisharebest\Webtrees\Http\RequestHandlers\AddChildToIndividualAction;
35use Fisharebest\Webtrees\Http\RequestHandlers\AddChildToIndividualPage;
36use Fisharebest\Webtrees\Http\RequestHandlers\AddMediaFileAction;
37use Fisharebest\Webtrees\Http\RequestHandlers\AddMediaFileModal;
38use Fisharebest\Webtrees\Http\RequestHandlers\AddName;
39use Fisharebest\Webtrees\Http\RequestHandlers\AddNewFact;
40use Fisharebest\Webtrees\Http\RequestHandlers\AddParentToIndividualAction;
41use Fisharebest\Webtrees\Http\RequestHandlers\AddParentToIndividualPage;
42use Fisharebest\Webtrees\Http\RequestHandlers\AddSpouseToFamilyAction;
43use Fisharebest\Webtrees\Http\RequestHandlers\AddSpouseToFamilyPage;
44use Fisharebest\Webtrees\Http\RequestHandlers\AddSpouseToIndividualAction;
45use Fisharebest\Webtrees\Http\RequestHandlers\AddSpouseToIndividualPage;
46use Fisharebest\Webtrees\Http\RequestHandlers\AddUnlinkedAction;
47use Fisharebest\Webtrees\Http\RequestHandlers\AddUnlinkedPage;
48use Fisharebest\Webtrees\Http\RequestHandlers\AdminMediaFileDownload;
49use Fisharebest\Webtrees\Http\RequestHandlers\AdminMediaFileThumbnail;
50use Fisharebest\Webtrees\Http\RequestHandlers\AppleTouchIconPng;
51use Fisharebest\Webtrees\Http\RequestHandlers\AutoCompleteCitation;
52use Fisharebest\Webtrees\Http\RequestHandlers\AutoCompleteFolder;
53use Fisharebest\Webtrees\Http\RequestHandlers\AutoCompletePlace;
54use Fisharebest\Webtrees\Http\RequestHandlers\AutoCompleteSurname;
55use Fisharebest\Webtrees\Http\RequestHandlers\BroadcastAction;
56use Fisharebest\Webtrees\Http\RequestHandlers\BroadcastPage;
57use Fisharebest\Webtrees\Http\RequestHandlers\CalendarAction;
58use Fisharebest\Webtrees\Http\RequestHandlers\CalendarEvents;
59use Fisharebest\Webtrees\Http\RequestHandlers\CalendarPage;
60use Fisharebest\Webtrees\Http\RequestHandlers\ChangeFamilyMembersAction;
61use Fisharebest\Webtrees\Http\RequestHandlers\ChangeFamilyMembersPage;
62use Fisharebest\Webtrees\Http\RequestHandlers\CheckTree;
63use Fisharebest\Webtrees\Http\RequestHandlers\CleanDataFolder;
64use Fisharebest\Webtrees\Http\RequestHandlers\ContactAction;
65use Fisharebest\Webtrees\Http\RequestHandlers\ContactPage;
66use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
67use Fisharebest\Webtrees\Http\RequestHandlers\CopyFact;
68use Fisharebest\Webtrees\Http\RequestHandlers\CreateMediaObjectAction;
69use Fisharebest\Webtrees\Http\RequestHandlers\CreateMediaObjectFromFile;
70use Fisharebest\Webtrees\Http\RequestHandlers\CreateMediaObjectModal;
71use Fisharebest\Webtrees\Http\RequestHandlers\CreateNoteAction;
72use Fisharebest\Webtrees\Http\RequestHandlers\CreateNoteModal;
73use Fisharebest\Webtrees\Http\RequestHandlers\CreateRepositoryAction;
74use Fisharebest\Webtrees\Http\RequestHandlers\CreateRepositoryModal;
75use Fisharebest\Webtrees\Http\RequestHandlers\CreateSourceAction;
76use Fisharebest\Webtrees\Http\RequestHandlers\CreateSourceModal;
77use Fisharebest\Webtrees\Http\RequestHandlers\CreateSubmitterAction;
78use Fisharebest\Webtrees\Http\RequestHandlers\CreateSubmitterModal;
79use Fisharebest\Webtrees\Http\RequestHandlers\CreateTreeAction;
80use Fisharebest\Webtrees\Http\RequestHandlers\CreateTreePage;
81use Fisharebest\Webtrees\Http\RequestHandlers\DataFixChoose;
82use Fisharebest\Webtrees\Http\RequestHandlers\DataFixData;
83use Fisharebest\Webtrees\Http\RequestHandlers\DataFixPage;
84use Fisharebest\Webtrees\Http\RequestHandlers\DataFixPreview;
85use Fisharebest\Webtrees\Http\RequestHandlers\DataFixSelect;
86use Fisharebest\Webtrees\Http\RequestHandlers\DataFixUpdate;
87use Fisharebest\Webtrees\Http\RequestHandlers\DataFixUpdateAll;
88use Fisharebest\Webtrees\Http\RequestHandlers\DeleteFact;
89use Fisharebest\Webtrees\Http\RequestHandlers\DeletePath;
90use Fisharebest\Webtrees\Http\RequestHandlers\DeleteRecord;
91use Fisharebest\Webtrees\Http\RequestHandlers\DeleteTreeAction;
92use Fisharebest\Webtrees\Http\RequestHandlers\DeleteUser;
93use Fisharebest\Webtrees\Http\RequestHandlers\EditFactAction;
94use Fisharebest\Webtrees\Http\RequestHandlers\EditFactPage;
95use Fisharebest\Webtrees\Http\RequestHandlers\EditMediaFileAction;
96use Fisharebest\Webtrees\Http\RequestHandlers\EditMediaFileModal;
97use Fisharebest\Webtrees\Http\RequestHandlers\EditName;
98use Fisharebest\Webtrees\Http\RequestHandlers\EditNoteAction;
99use Fisharebest\Webtrees\Http\RequestHandlers\EditNotePage;
100use Fisharebest\Webtrees\Http\RequestHandlers\EditRawFactAction;
101use Fisharebest\Webtrees\Http\RequestHandlers\EditRawFactPage;
102use Fisharebest\Webtrees\Http\RequestHandlers\EditRawRecordAction;
103use Fisharebest\Webtrees\Http\RequestHandlers\EditRawRecordPage;
104use Fisharebest\Webtrees\Http\RequestHandlers\EmailPreferencesAction;
105use Fisharebest\Webtrees\Http\RequestHandlers\EmailPreferencesPage;
106use Fisharebest\Webtrees\Http\RequestHandlers\ExportGedcomClient;
107use Fisharebest\Webtrees\Http\RequestHandlers\ExportGedcomPage;
108use Fisharebest\Webtrees\Http\RequestHandlers\ExportGedcomServer;
109use Fisharebest\Webtrees\Http\RequestHandlers\FamilyPage;
110use Fisharebest\Webtrees\Http\RequestHandlers\FaviconIco;
111use Fisharebest\Webtrees\Http\RequestHandlers\FindDuplicateRecords;
112use Fisharebest\Webtrees\Http\RequestHandlers\GedcomLoad;
113use Fisharebest\Webtrees\Http\RequestHandlers\GedcomRecordPage;
114use Fisharebest\Webtrees\Http\RequestHandlers\HeaderPage;
115use Fisharebest\Webtrees\Http\RequestHandlers\HelpText;
116use Fisharebest\Webtrees\Http\RequestHandlers\HomePage;
117use Fisharebest\Webtrees\Http\RequestHandlers\ImportGedcomAction;
118use Fisharebest\Webtrees\Http\RequestHandlers\ImportGedcomPage;
119use Fisharebest\Webtrees\Http\RequestHandlers\IndividualPage;
120use Fisharebest\Webtrees\Http\RequestHandlers\LinkChildToFamilyAction;
121use Fisharebest\Webtrees\Http\RequestHandlers\LinkChildToFamilyPage;
122use Fisharebest\Webtrees\Http\RequestHandlers\LinkMediaToFamilyModal;
123use Fisharebest\Webtrees\Http\RequestHandlers\LinkMediaToIndividualModal;
124use Fisharebest\Webtrees\Http\RequestHandlers\LinkMediaToRecordAction;
125use Fisharebest\Webtrees\Http\RequestHandlers\LinkMediaToSourceModal;
126use Fisharebest\Webtrees\Http\RequestHandlers\LinkSpouseToIndividualAction;
127use Fisharebest\Webtrees\Http\RequestHandlers\LinkSpouseToIndividualPage;
128use Fisharebest\Webtrees\Http\RequestHandlers\LoginAction;
129use Fisharebest\Webtrees\Http\RequestHandlers\LoginPage;
130use Fisharebest\Webtrees\Http\RequestHandlers\Logout;
131use Fisharebest\Webtrees\Http\RequestHandlers\ManageMediaAction;
132use Fisharebest\Webtrees\Http\RequestHandlers\ManageMediaData;
133use Fisharebest\Webtrees\Http\RequestHandlers\ManageMediaPage;
134use Fisharebest\Webtrees\Http\RequestHandlers\ManageTrees;
135use Fisharebest\Webtrees\Http\RequestHandlers\MapDataDelete;
136use Fisharebest\Webtrees\Http\RequestHandlers\MapDataList;
137use Fisharebest\Webtrees\Http\RequestHandlers\MapProviderAction;
138use Fisharebest\Webtrees\Http\RequestHandlers\MapProviderPage;
139use Fisharebest\Webtrees\Http\RequestHandlers\Masquerade;
140use Fisharebest\Webtrees\Http\RequestHandlers\MediaFileDownload;
141use Fisharebest\Webtrees\Http\RequestHandlers\MediaFileThumbnail;
142use Fisharebest\Webtrees\Http\RequestHandlers\MediaPage;
143use Fisharebest\Webtrees\Http\RequestHandlers\MergeFactsAction;
144use Fisharebest\Webtrees\Http\RequestHandlers\MergeFactsPage;
145use Fisharebest\Webtrees\Http\RequestHandlers\MergeRecordsAction;
146use Fisharebest\Webtrees\Http\RequestHandlers\MergeRecordsPage;
147use Fisharebest\Webtrees\Http\RequestHandlers\MergeTreesAction;
148use Fisharebest\Webtrees\Http\RequestHandlers\MergeTreesPage;
149use Fisharebest\Webtrees\Http\RequestHandlers\MessageAction;
150use Fisharebest\Webtrees\Http\RequestHandlers\MessagePage;
151use Fisharebest\Webtrees\Http\RequestHandlers\MessageSelect;
152use Fisharebest\Webtrees\Http\RequestHandlers\ModuleAction;
153use Fisharebest\Webtrees\Http\RequestHandlers\ModuleDeleteSettings;
154use Fisharebest\Webtrees\Http\RequestHandlers\ModulesAllAction;
155use Fisharebest\Webtrees\Http\RequestHandlers\ModulesAllPage;
156use Fisharebest\Webtrees\Http\RequestHandlers\ModulesAnalyticsAction;
157use Fisharebest\Webtrees\Http\RequestHandlers\ModulesAnalyticsPage;
158use Fisharebest\Webtrees\Http\RequestHandlers\ModulesBlocksAction;
159use Fisharebest\Webtrees\Http\RequestHandlers\ModulesBlocksPage;
160use Fisharebest\Webtrees\Http\RequestHandlers\ModulesChartsAction;
161use Fisharebest\Webtrees\Http\RequestHandlers\ModulesChartsPage;
162use Fisharebest\Webtrees\Http\RequestHandlers\ModulesDataFixesAction;
163use Fisharebest\Webtrees\Http\RequestHandlers\ModulesDataFixesPage;
164use Fisharebest\Webtrees\Http\RequestHandlers\ModulesFootersAction;
165use Fisharebest\Webtrees\Http\RequestHandlers\ModulesFootersPage;
166use Fisharebest\Webtrees\Http\RequestHandlers\ModulesHistoricEventsAction;
167use Fisharebest\Webtrees\Http\RequestHandlers\ModulesHistoricEventsPage;
168use Fisharebest\Webtrees\Http\RequestHandlers\ModulesLanguagesAction;
169use Fisharebest\Webtrees\Http\RequestHandlers\ModulesLanguagesPage;
170use Fisharebest\Webtrees\Http\RequestHandlers\ModulesListsAction;
171use Fisharebest\Webtrees\Http\RequestHandlers\ModulesListsPage;
172use Fisharebest\Webtrees\Http\RequestHandlers\ModulesMenusAction;
173use Fisharebest\Webtrees\Http\RequestHandlers\ModulesMenusPage;
174use Fisharebest\Webtrees\Http\RequestHandlers\ModulesReportsAction;
175use Fisharebest\Webtrees\Http\RequestHandlers\ModulesReportsPage;
176use Fisharebest\Webtrees\Http\RequestHandlers\ModulesSidebarsAction;
177use Fisharebest\Webtrees\Http\RequestHandlers\ModulesSidebarsPage;
178use Fisharebest\Webtrees\Http\RequestHandlers\ModulesTabsAction;
179use Fisharebest\Webtrees\Http\RequestHandlers\ModulesTabsPage;
180use Fisharebest\Webtrees\Http\RequestHandlers\ModulesThemesAction;
181use Fisharebest\Webtrees\Http\RequestHandlers\ModulesThemesPage;
182use Fisharebest\Webtrees\Http\RequestHandlers\NotePage;
183use Fisharebest\Webtrees\Http\RequestHandlers\PasswordRequestAction;
184use Fisharebest\Webtrees\Http\RequestHandlers\PasswordRequestPage;
185use Fisharebest\Webtrees\Http\RequestHandlers\PasswordResetAction;
186use Fisharebest\Webtrees\Http\RequestHandlers\PasswordResetPage;
187use Fisharebest\Webtrees\Http\RequestHandlers\PasteFact;
188use Fisharebest\Webtrees\Http\RequestHandlers\PendingChanges;
189use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesAcceptChange;
190use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesAcceptRecord;
191use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesAcceptTree;
192use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesLogAction;
193use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesLogData;
194use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesLogDelete;
195use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesLogDownload;
196use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesLogPage;
197use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesRejectChange;
198use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesRejectRecord;
199use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesRejectTree;
200use Fisharebest\Webtrees\Http\RequestHandlers\PhpInformation;
201use Fisharebest\Webtrees\Http\RequestHandlers\Ping;
202use Fisharebest\Webtrees\Http\RequestHandlers\RegisterAction;
203use Fisharebest\Webtrees\Http\RequestHandlers\RegisterPage;
204use Fisharebest\Webtrees\Http\RequestHandlers\RenumberTreeAction;
205use Fisharebest\Webtrees\Http\RequestHandlers\RenumberTreePage;
206use Fisharebest\Webtrees\Http\RequestHandlers\ReorderChildrenAction;
207use Fisharebest\Webtrees\Http\RequestHandlers\ReorderChildrenPage;
208use Fisharebest\Webtrees\Http\RequestHandlers\ReorderFamiliesAction;
209use Fisharebest\Webtrees\Http\RequestHandlers\ReorderFamiliesPage;
210use Fisharebest\Webtrees\Http\RequestHandlers\ReorderMediaAction;
211use Fisharebest\Webtrees\Http\RequestHandlers\ReorderMediaPage;
212use Fisharebest\Webtrees\Http\RequestHandlers\ReorderNamesAction;
213use Fisharebest\Webtrees\Http\RequestHandlers\ReorderNamesPage;
214use Fisharebest\Webtrees\Http\RequestHandlers\ReportGenerate;
215use Fisharebest\Webtrees\Http\RequestHandlers\ReportListAction;
216use Fisharebest\Webtrees\Http\RequestHandlers\ReportListPage;
217use Fisharebest\Webtrees\Http\RequestHandlers\ReportSetupAction;
218use Fisharebest\Webtrees\Http\RequestHandlers\ReportSetupPage;
219use Fisharebest\Webtrees\Http\RequestHandlers\RepositoryPage;
220use Fisharebest\Webtrees\Http\RequestHandlers\RobotsTxt;
221use Fisharebest\Webtrees\Http\RequestHandlers\SearchAdvancedAction;
222use Fisharebest\Webtrees\Http\RequestHandlers\SearchAdvancedPage;
223use Fisharebest\Webtrees\Http\RequestHandlers\SearchGeneralAction;
224use Fisharebest\Webtrees\Http\RequestHandlers\SearchGeneralPage;
225use Fisharebest\Webtrees\Http\RequestHandlers\SearchPhoneticAction;
226use Fisharebest\Webtrees\Http\RequestHandlers\SearchPhoneticPage;
227use Fisharebest\Webtrees\Http\RequestHandlers\SearchQuickAction;
228use Fisharebest\Webtrees\Http\RequestHandlers\SearchReplaceAction;
229use Fisharebest\Webtrees\Http\RequestHandlers\SearchReplacePage;
230use Fisharebest\Webtrees\Http\RequestHandlers\Select2Family;
231use Fisharebest\Webtrees\Http\RequestHandlers\Select2Individual;
232use Fisharebest\Webtrees\Http\RequestHandlers\Select2MediaObject;
233use Fisharebest\Webtrees\Http\RequestHandlers\Select2Note;
234use Fisharebest\Webtrees\Http\RequestHandlers\Select2Place;
235use Fisharebest\Webtrees\Http\RequestHandlers\Select2Repository;
236use Fisharebest\Webtrees\Http\RequestHandlers\Select2Source;
237use Fisharebest\Webtrees\Http\RequestHandlers\Select2Submitter;
238use Fisharebest\Webtrees\Http\RequestHandlers\SelectDefaultTree;
239use Fisharebest\Webtrees\Http\RequestHandlers\SelectLanguage;
240use Fisharebest\Webtrees\Http\RequestHandlers\SelectNewFact;
241use Fisharebest\Webtrees\Http\RequestHandlers\SelectTheme;
242use Fisharebest\Webtrees\Http\RequestHandlers\SiteLogsAction;
243use Fisharebest\Webtrees\Http\RequestHandlers\SiteLogsData;
244use Fisharebest\Webtrees\Http\RequestHandlers\SiteLogsDelete;
245use Fisharebest\Webtrees\Http\RequestHandlers\SiteLogsDownload;
246use Fisharebest\Webtrees\Http\RequestHandlers\SiteLogsPage;
247use Fisharebest\Webtrees\Http\RequestHandlers\SitePreferencesAction;
248use Fisharebest\Webtrees\Http\RequestHandlers\SitePreferencesPage;
249use Fisharebest\Webtrees\Http\RequestHandlers\SiteRegistrationAction;
250use Fisharebest\Webtrees\Http\RequestHandlers\SiteRegistrationPage;
251use Fisharebest\Webtrees\Http\RequestHandlers\SourcePage;
252use Fisharebest\Webtrees\Http\RequestHandlers\SubmissionPage;
253use Fisharebest\Webtrees\Http\RequestHandlers\SubmitterPage;
254use Fisharebest\Webtrees\Http\RequestHandlers\SynchronizeTrees;
255use Fisharebest\Webtrees\Http\RequestHandlers\TreePage;
256use Fisharebest\Webtrees\Http\RequestHandlers\TreePageBlock;
257use Fisharebest\Webtrees\Http\RequestHandlers\TreePageBlockEdit;
258use Fisharebest\Webtrees\Http\RequestHandlers\TreePageBlockUpdate;
259use Fisharebest\Webtrees\Http\RequestHandlers\TreePageDefaultEdit;
260use Fisharebest\Webtrees\Http\RequestHandlers\TreePageDefaultUpdate;
261use Fisharebest\Webtrees\Http\RequestHandlers\TreePageEdit;
262use Fisharebest\Webtrees\Http\RequestHandlers\TreePageUpdate;
263use Fisharebest\Webtrees\Http\RequestHandlers\TreePreferencesAction;
264use Fisharebest\Webtrees\Http\RequestHandlers\TreePreferencesPage;
265use Fisharebest\Webtrees\Http\RequestHandlers\TreePrivacyAction;
266use Fisharebest\Webtrees\Http\RequestHandlers\TreePrivacyPage;
267use Fisharebest\Webtrees\Http\RequestHandlers\UnconnectedAction;
268use Fisharebest\Webtrees\Http\RequestHandlers\UnconnectedPage;
269use Fisharebest\Webtrees\Http\RequestHandlers\UploadMediaAction;
270use Fisharebest\Webtrees\Http\RequestHandlers\UploadMediaPage;
271use Fisharebest\Webtrees\Http\RequestHandlers\UserPage;
272use Fisharebest\Webtrees\Http\RequestHandlers\UserPageBlock;
273use Fisharebest\Webtrees\Http\RequestHandlers\UserPageBlockEdit;
274use Fisharebest\Webtrees\Http\RequestHandlers\UserPageBlockUpdate;
275use Fisharebest\Webtrees\Http\RequestHandlers\UserPageDefaultEdit;
276use Fisharebest\Webtrees\Http\RequestHandlers\UserPageDefaultUpdate;
277use Fisharebest\Webtrees\Http\RequestHandlers\UserPageEdit;
278use Fisharebest\Webtrees\Http\RequestHandlers\UserPageUpdate;
279use Fisharebest\Webtrees\Http\RequestHandlers\UsersCleanupAction;
280use Fisharebest\Webtrees\Http\RequestHandlers\UsersCleanupPage;
281use Fisharebest\Webtrees\Http\RequestHandlers\VerifyEmail;
282
283/**
284 * Routing table for web requests
285 */
286class WebRoutes
287{
288    public function load(Map $router): void
289    {
290        $router->attach('', '', static function (Map $router) {
291            // Admin routes.
292            $router->attach('', '/admin', static function (Map $router) {
293                $router->extras([
294                    'middleware' => [
295                        AuthAdministrator::class,
296                    ],
297                ]);
298
299                $router->get(ControlPanel::class, '');
300                $router->get(BroadcastPage::class, '/broadcast');
301                $router->post(BroadcastAction::class, '/broadcast');
302                $router->get(CleanDataFolder::class, '/clean');
303                $router->post(DeletePath::class, '/delete-path');
304                $router->get(EmailPreferencesPage::class, '/email');
305                $router->post(EmailPreferencesAction::class, '/email');
306                $router->get(PhpInformation::class, '/information');
307                $router->get(SiteLogsPage::class, '/logs');
308                $router->post(SiteLogsAction::class, '/logs');
309                $router->get(SiteLogsData::class, '/logs-data');
310                $router->post(SiteLogsDelete::class, '/logs-delete');
311                $router->get(SiteLogsDownload::class, '/logs-download');
312                $router->post(Masquerade::class, '/masquerade/{user_id}');
313                $router->get(ManageMediaPage::class, '/media');
314                $router->post(ManageMediaAction::class, '/media');
315                $router->get(ManageMediaData::class, '/media-data');
316                $router->get(UploadMediaPage::class, '/media-upload');
317                $router->post(UploadMediaAction::class, '/media-upload');
318                $router->get(AdminMediaFileDownload::class, '/media-file');
319                $router->get(AdminMediaFileThumbnail::class, '/media-thumbnail');
320                $router->get(CreateTreePage::class, '/trees/create');
321                $router->post(CreateTreeAction::class, '/trees/create');
322                $router->post(SelectDefaultTree::class, '/trees/default/{tree}');
323                $router->post(DeleteTreeAction::class, '/trees/delete/{tree}');
324                $router->get('admin-fix-level-0-media', '/fix-level-0-media', 'Admin\FixLevel0MediaController::fixLevel0Media');
325                $router->post('admin-fix-level-0-media-action', '/fix-level-0-media', 'Admin\FixLevel0MediaController::fixLevel0MediaAction');
326                $router->get('admin-fix-level-0-media-data', '/fix-level-0-media-data', 'Admin\FixLevel0MediaController::fixLevel0MediaData');
327                $router->get('admin-webtrees1-thumbs', '/webtrees1-thumbs', 'Admin\ImportThumbnailsController::webtrees1Thumbnails');
328                $router->post('admin-webtrees1-thumbs-action', '/webtrees1-thumbs', 'Admin\ImportThumbnailsController::webtrees1ThumbnailsAction');
329                $router->get('admin-webtrees1-thumbs-data', '/webtrees1-thumbs-data', 'Admin\ImportThumbnailsController::webtrees1ThumbnailsData');
330                $router->get(UsersCleanupPage::class, '/users-cleanup');
331                $router->post(UsersCleanupAction::class, '/users-cleanup');
332                $router->get(MapDataList::class, '/map-data');
333                $router->get('map-data-edit', '/map-data-edit', 'Admin\LocationController::mapDataEdit');
334                $router->post('map-data-update', '/map-data-edit', 'Admin\LocationController::mapDataSave');
335                $router->post(MapDataDelete::class, '/map-data-delete');
336                $router->get('locations-export', '/locations-export', 'Admin\LocationController::exportLocations');
337                $router->get('locations-import', '/locations-import', 'Admin\LocationController::importLocations');
338                $router->post('locations-import-action', '/locations-import', 'Admin\LocationController::importLocationsAction');
339                $router->get(MapProviderPage::class, '/map-provider');
340                $router->post(MapProviderAction::class, '/map-provider');
341                $router->post(ModuleDeleteSettings::class, '/module-delete-settings');
342                $router->get(ModulesAllPage::class, '/modules');
343                $router->post(ModulesAllAction::class, '/modules');
344                $router->get(ModulesAnalyticsPage::class, '/analytics');
345                $router->post(ModulesAnalyticsAction::class, '/analytics');
346                $router->get(ModulesBlocksPage::class, '/blocks');
347                $router->post(ModulesBlocksAction::class, '/blocks');
348                $router->get(ModulesChartsPage::class, '/charts');
349                $router->post(ModulesChartsAction::class, '/charts');
350                $router->get(ModulesDataFixesPage::class, '/data-fixes');
351                $router->post(ModulesDataFixesAction::class, '/data-fixes');
352                $router->get(ModulesFootersPage::class, '/footers');
353                $router->post(ModulesFootersAction::class, '/footers');
354                $router->get(ModulesHistoricEventsPage::class, '/historic-events');
355                $router->post(ModulesHistoricEventsAction::class, '/historic-events');
356                $router->get(ModulesListsPage::class, '/lists');
357                $router->post(ModulesListsAction::class, '/lists');
358                $router->get(ModulesMenusPage::class, '/menus');
359                $router->post(ModulesMenusAction::class, '/menus');
360                $router->get(ModulesLanguagesPage::class, '/languages');
361                $router->post(ModulesLanguagesAction::class, '/languages');
362                $router->get(ModulesReportsPage::class, '/reports');
363                $router->post(ModulesReportsAction::class, '/reports');
364                $router->get(ModulesSidebarsPage::class, '/sidebars');
365                $router->post(ModulesSidebarsAction::class, '/sidebars');
366                $router->get(ModulesTabsPage::class, '/tabs');
367                $router->post(ModulesTabsAction::class, '/tabs');
368                $router->get(ModulesThemesPage::class, '/themes');
369                $router->post(ModulesThemesAction::class, '/themes');
370                $router->get('upgrade', '/upgrade', 'Admin\UpgradeController::wizard');
371                $router->post('upgrade-confirm', '/upgrade-confirm', 'Admin\UpgradeController::confirm');
372                $router->post('upgrade-action', '/upgrade', 'Admin\UpgradeController::step');
373                $router->get('admin-users', '/admin-users', 'Admin\UsersController::index');
374                $router->get('admin-users-data', '/admin-users-data', 'Admin\UsersController::data');
375                $router->get('admin-users-create', '/admin-users-create', 'Admin\UsersController::create');
376                $router->post('admin-users-create-action', '/admin-users-create', 'Admin\UsersController::save');
377                $router->get('admin-users-edit', '/admin-users-edit', 'Admin\UsersController::edit');
378                $router->post('admin-users-update', '/admin-users-edit', 'Admin\UsersController::update');
379                $router->get(SitePreferencesPage::class, '/site-preferences');
380                $router->post(SitePreferencesAction::class, '/site-preferences');
381                $router->get(SiteRegistrationPage::class, '/site-registration');
382                $router->post(SiteRegistrationAction::class, '/site-registration');
383                $router->get(TreePageDefaultEdit::class, '/trees/default-blocks');
384                $router->post(TreePageDefaultUpdate::class, '/trees/default-blocks');
385                $router->get(MergeTreesPage::class, '/trees/merge');
386                $router->post(MergeTreesAction::class, '/trees/merge');
387                $router->post(SynchronizeTrees::class, '/trees/sync');
388                $router->post(DeleteUser::class, '/users/delete/{user_id}');
389                $router->get(UserPageDefaultEdit::class, '/user-page-default-edit');
390                $router->post(UserPageDefaultUpdate::class, '/user-page-default-update');
391
392                // @deprecated since 2.0.8 - will be removed in 2.1.0
393                $router->get('modules', '/modules', ModulesAllPage::class);
394            });
395
396            // Manager routes (multiple trees).
397            $router->attach('', '/admin', static function (Map $router) {
398                $router->extras([
399                    'middleware' => [
400                        AuthManager::class,
401                    ],
402                ]);
403
404                $router->get(ManageTrees::class, '/trees/manage/{tree}');
405            });
406
407            // Manager routes.
408            $router->attach('', '/tree/{tree}', static function (Map $router) {
409                $router->extras([
410                    'middleware' => [
411                        AuthManager::class,
412                    ],
413                ]);
414
415                $router->get(PendingChangesLogPage::class, '/changes-log');
416                $router->post(PendingChangesLogAction::class, '/changes-log');
417                $router->get(PendingChangesLogData::class, '/changes-data');
418                $router->post(PendingChangesLogDelete::class, '/changes-delete');
419                $router->get(PendingChangesLogDownload::class, '/changes-download');
420                $router->get(CheckTree::class, '/check');
421                $router->get(DataFixChoose::class, '/data-fix');
422                $router->post(DataFixSelect::class, '/data-fix');
423                $router->get(DataFixPage::class, '/data-fix/{data_fix}');
424                $router->post(DataFixUpdate::class, '/data-fix/{data_fix}/update');
425                $router->post(DataFixUpdateAll::class, '/data-fix/{data_fix}/update-all');
426                $router->get(DataFixData::class, '/data-fix/{data_fix}/data');
427                $router->get(DataFixPreview::class, '/data-fix/{data_fix}/preview');
428                $router->get(FindDuplicateRecords::class, '/duplicates');
429                $router->get(ExportGedcomPage::class, '/export');
430                $router->post(ExportGedcomClient::class, '/export-client');
431                $router->post(ExportGedcomServer::class, '/export-server');
432                $router->get(ImportGedcomPage::class, '/import');
433                $router->post(ImportGedcomAction::class, '/import');
434                $router->get(MergeRecordsPage::class, '/merge-step1');
435                $router->post(MergeRecordsAction::class, '/merge-step1');
436                $router->get(MergeFactsPage::class, '/merge-step2');
437                $router->post(MergeFactsAction::class, '/merge-step2');
438                $router->get(TreePreferencesPage::class, '/preferences');
439                $router->post(TreePreferencesAction::class, '/preferences');
440                $router->get(RenumberTreePage::class, '/renumber');
441                $router->post(RenumberTreeAction::class, '/renumber');
442                $router->get(TreePageEdit::class, '/tree-page-edit');
443                $router->post(GedcomLoad::class, '/load');
444                $router->post(TreePageUpdate::class, '/tree-page-update');
445                $router->get(TreePageBlockEdit::class, '/tree-page-block-edit');
446                $router->post(TreePageBlockUpdate::class, '/tree-page-block-edit');
447                $router->get(TreePrivacyPage::class, '/privacy');
448                $router->post(TreePrivacyAction::class, '/privacy');
449                $router->get(UnconnectedPage::class, '/unconnected');
450                $router->post(UnconnectedAction::class, '/unconnected');
451            });
452
453            // Moderator routes.
454            $router->attach('', '/tree/{tree}', static function (Map $router) {
455                $router->extras([
456                    'middleware' => [
457                        AuthModerator::class,
458                    ],
459                ]);
460                $router->post(PendingChangesAcceptTree::class, '/accept');
461                $router->post(PendingChangesAcceptRecord::class, '/accept/{xref}');
462                $router->post(PendingChangesAcceptChange::class, '/accept/{xref}/{change}');
463                $router->get(PendingChanges::class, '/pending');
464                $router->post(PendingChangesRejectTree::class, '/reject');
465                $router->post(PendingChangesRejectRecord::class, '/reject/{xref}');
466                $router->post(PendingChangesRejectChange::class, '/reject/{xref}/{change}');
467            });
468
469            // Editor routes.
470            $router->attach('', '/tree/{tree}', static function (Map $router) {
471                $router->extras([
472                    'middleware' => [
473                        AuthEditor::class,
474                    ],
475                ]);
476
477                $router->get(AutoCompleteCitation::class, '/autocomplete/citation/{query}');
478                $router->get(AutoCompleteFolder::class, '/autocomplete/folder/{query}');
479                $router->get(AutoCompletePlace::class, '/autocomplete/place/{query}');
480                $router->get(AutoCompleteSurname::class, '/autocomplete/surname/{query}');
481                $router->get(AddChildToFamilyPage::class, '/add-child-to-family');
482                $router->post(AddChildToFamilyAction::class, '/add-child-to-family');
483                $router->get(AddNewFact::class, '/add-fact/{xref}/{fact}');
484                $router->post(SelectNewFact::class, '/add-fact/{xref}');
485                $router->get(AddMediaFileModal::class, '/add-media-file/{xref}');
486                $router->post(AddMediaFileAction::class, '/add-media-file/{xref}');
487                $router->get(AddName::class, '/add-name');
488                $router->get(AddSpouseToFamilyPage::class, '/add-spouse-to-family');
489                $router->post(AddSpouseToFamilyAction::class, '/add-spouse-to-family');
490                $router->get(ChangeFamilyMembersPage::class, '/change-family-members');
491                $router->post(ChangeFamilyMembersAction::class, '/change-family-members');
492                $router->get(CreateMediaObjectModal::class, '/create-media-object');
493                $router->post(CreateMediaObjectAction::class, '/create-media-object');
494                $router->post(CreateMediaObjectFromFile::class, '/create-media-from-file');
495                $router->post(CopyFact::class, '/copy/{xref}/{fact_id}');
496                $router->get(CreateNoteModal::class, '/create-note-object');
497                $router->post(CreateNoteAction::class, '/create-note-object');
498                $router->get(CreateRepositoryModal::class, '/create-repository');
499                $router->post(CreateRepositoryAction::class, '/create-repository');
500                $router->get(CreateSourceModal::class, '/create-source');
501                $router->post(CreateSourceAction::class, '/create-source');
502                $router->get(CreateSubmitterModal::class, '/create-submitter');
503                $router->post(CreateSubmitterAction::class, '/create-submitter');
504                $router->post(DeleteRecord::class, '/delete/{xref}');
505                $router->post(DeleteFact::class, '/delete/{xref}/{fact_id}');
506                $router->get(EditFactPage::class, '/edit-fact/{xref}/{fact_id}');
507                $router->post(EditFactAction::class, '/update-fact/{xref}{/fact_id}');
508                $router->get(EditMediaFileModal::class, '/edit-media-file/{xref}/{fact_id}');
509                $router->post(EditMediaFileAction::class, '/edit-media-file/{xref}/{fact_id}');
510                $router->get(EditNotePage::class, '/edit-note-object/{xref}');
511                $router->post(EditNoteAction::class, '/edit-note-object/{xref}');
512                $router->get(EditRawFactPage::class, '/edit-raw/{xref}/{fact_id}');
513                $router->post(EditRawFactAction::class, '/edit-raw/{xref}/{fact_id}');
514                $router->get(EditRawRecordPage::class, '/edit-raw/{xref}');
515                $router->post(EditRawRecordAction::class, '/edit-raw/{xref}');
516                $router->get(LinkMediaToFamilyModal::class, '/link-media-to-family/{xref}');
517                $router->get(LinkMediaToIndividualModal::class, '/link-media-to-individual/{xref}');
518                $router->get(LinkMediaToSourceModal::class, '/link-media-to-source/{xref}');
519                $router->post(LinkMediaToRecordAction::class, '/link-media-to-record/{xref}');
520                $router->post(PasteFact::class, '/paste-fact/{xref}');
521                $router->get(ReorderChildrenPage::class, '/reorder-children/{xref}');
522                $router->post(ReorderChildrenAction::class, '/reorder-children/{xref}');
523                $router->get(ReorderMediaPage::class, '/reorder-media/{xref}');
524                $router->post(ReorderMediaAction::class, '/reorder-media/{xref}');
525                $router->get(ReorderNamesPage::class, '/reorder-names/{xref}');
526                $router->post(ReorderNamesAction::class, '/reorder-names/{xref}');
527                $router->get(ReorderFamiliesPage::class, '/reorder-spouses/{xref}');
528                $router->post(ReorderFamiliesAction::class, '/reorder-spouses/{xref}');
529                $router->get(SearchReplacePage::class, '/search-replace');
530                $router->post(SearchReplaceAction::class, '/search-replace');
531                $router->get(AddChildToIndividualPage::class, '/add-child-to-individual');
532                $router->post(AddChildToIndividualAction::class, '/add-child-to-individual');
533                $router->get(AddParentToIndividualPage::class, '/add-parent-to-individual');
534                $router->post(AddParentToIndividualAction::class, '/add-parent-to-individual');
535                $router->get(AddSpouseToIndividualPage::class, '/add-spouse-to-individual');
536                $router->post(AddSpouseToIndividualAction::class, '/add-spouse-to-individual');
537                $router->get(AddUnlinkedPage::class, '/add-unlinked-individual');
538                $router->post(AddUnlinkedAction::class, '/add-unlinked-individual');
539                $router->get(LinkChildToFamilyPage::class, '/link-child-to-family');
540                $router->post(LinkChildToFamilyAction::class, '/link-child-to-family');
541                $router->get(LinkSpouseToIndividualPage::class, '/link-spouse-to-individual');
542                $router->post(LinkSpouseToIndividualAction::class, '/link-spouse-to-individual');
543                $router->get(EditName::class, '/edit-name/{xref}/{fact_id}');
544            });
545
546            // User routes with a tree.
547            $router->attach('', '/tree/{tree}', static function (Map $router) {
548                $router->extras([
549                    'middleware' => [
550                        AuthLoggedIn::class,
551                    ],
552                ]);
553
554                $router->post(MessageSelect::class, '/message-select');
555                $router->get(MessagePage::class, '/message-compose');
556                $router->post(MessageAction::class, '/message-send');
557                $router->get(UserPage::class, '/my-page');
558                $router->get(UserPageBlock::class, '/my-page-block');
559                $router->get(UserPageEdit::class, '/my-page-edit');
560                $router->post(UserPageUpdate::class, '/my-page-edit');
561                $router->get(UserPageBlockEdit::class, '/my-page-block-edit');
562                $router->post(UserPageBlockUpdate::class, '/my-page-block-edit');
563            });
564
565            // User routes without a tree.
566            $router->attach('', '', static function (Map $router) {
567                $router->extras([
568                    'middleware' => [
569                        AuthLoggedIn::class,
570                    ],
571                ]);
572
573                $router->get(AccountEdit::class, '/my-account{/tree}');
574                $router->post(AccountUpdate::class, '/my-account{/tree}');
575                $router->post(AccountDelete::class, '/my-account-delete');
576            });
577
578            // Visitor routes - with an optional tree (for sites with no public trees).
579            $router->attach('', '', static function (Map $router) {
580                $router->get(LoginPage::class, '/login{/tree}');
581                $router->post(LoginAction::class, '/login{/tree}');
582                $router->get(PasswordRequestPage::class, '/password-request{/tree}');
583                $router->post(PasswordRequestAction::class, '/password-request{/tree}');
584                $router->get(RegisterPage::class, '/register{/tree}');
585                $router->post(RegisterAction::class, '/register{/tree}');
586                $router->get(PasswordResetPage::class, '/password-reset/{token}{/tree}');
587                $router->post(PasswordResetAction::class, '/password-reset/{token}{/tree}');
588                $router->get(VerifyEmail::class, '/verify/{username}/{token}{/tree}');
589            });
590
591            // Visitor routes with a tree.
592            $router->attach('', '/tree/{tree}', static function (Map $router) {
593                $router->get(TreePage::class, '');
594                $router->get(CalendarPage::class, '/calendar/{view}');
595                $router->post(CalendarAction::class, '/calendar/{view}');
596                $router->get(CalendarEvents::class, '/calendar-events/{view}');
597                $router->get(ContactPage::class, '/contact');
598                $router->post(ContactAction::class, '/contact');
599                $router->get(FamilyPage::class, '/family/{xref}{/slug}');
600                $router->get(HeaderPage::class, '/header/{xref}{/slug}');
601                $router->get(IndividualPage::class, '/individual/{xref}{/slug}');
602                $router->get(MediaFileThumbnail::class, '/media-thumbnail');
603                $router->get(MediaFileDownload::class, '/media-download');
604                $router->get(MediaPage::class, '/media/{xref}{/slug}');
605                $router->get(NotePage::class, '/note/{xref}{/slug}');
606                $router->get(GedcomRecordPage::class, '/record/{xref}{/slug}');
607                $router->get(RepositoryPage::class, '/repository/{xref}{/slug}');
608                $router->get(ReportListPage::class, '/report');
609                $router->post(ReportListAction::class, '/report');
610                $router->get(ReportSetupPage::class, '/report/{report}');
611                $router->post(ReportSetupAction::class, '/report/{report}');
612                $router->get(ReportGenerate::class, '/report-run/{report}');
613                $router->get(SearchAdvancedPage::class, '/search-advanced');
614                $router->post(SearchAdvancedAction::class, '/search-advanced');
615                $router->get(SearchGeneralPage::class, '/search-general');
616                $router->post(SearchGeneralAction::class, '/search-general');
617                $router->get(SearchPhoneticPage::class, '/search-phonetic');
618                $router->post(SearchPhoneticAction::class, '/search-phonetic');
619                $router->post(SearchQuickAction::class, '/search-quick');
620                $router->post(Select2Family::class, '/select2-family');
621                $router->post(Select2Individual::class, '/select2-individual');
622                $router->post(Select2MediaObject::class, '/select2-media');
623                $router->post(Select2Note::class, '/select2-note');
624                $router->post(Select2Place::class, '/select2-place');
625                $router->post(Select2Source::class, '/select2-source');
626                $router->post(Select2Submitter::class, '/select2-submitter');
627                $router->post(Select2Repository::class, '/select2-repository');
628                $router->get(SourcePage::class, '/source/{xref}{/slug}');
629                $router->get(SubmissionPage::class, '/submission/{xref}{/slug}');
630                $router->get(SubmitterPage::class, '/submitter/{xref}{/slug}');
631                $router->get(TreePageBlock::class, '/tree-page-block');
632                $router->get('example', '/…')
633                    ->isRoutable(false);
634            });
635
636            // Match module routes, with and without a tree.
637            $router->get('module-tree', '/module/{module}/{action}/{tree}', ModuleAction::class)
638                ->allows(RequestMethodInterface::METHOD_POST);
639            $router->get('module-no-tree', '/module/{module}/{action}', ModuleAction::class)
640                ->allows(RequestMethodInterface::METHOD_POST);
641            // Generate module routes only. The router cannot distinguish a private tree from no tree.
642            $router->get('module', '/module/{module}/{action}{/tree}')
643                ->isRoutable(false);
644
645            $router->get(HelpText::class, '/help/{topic}');
646            $router->post(SelectLanguage::class, '/language/{language}');
647            $router->post(Logout::class, '/logout');
648            $router->get(Ping::class, '/ping', Ping::class)
649                ->allows(RequestMethodInterface::METHOD_HEAD);
650            $router->get(RobotsTxt::class, '/robots.txt');
651            $router->post(SelectTheme::class, '/theme/{theme}');
652            $router->get(HomePage::class, '/');
653
654            // Some URL rewrite configurations will pass everything not in /public to index.php
655            $router->get(AppleTouchIconPng::class, '/apple-touch-icon.png');
656            $router->get(FaviconIco::class, '/favicon.ico');
657        });
658    }
659}
660