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