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