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