From 295cd0160525125bbd7756d7ad07392ae7201cb8 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Wed, 17 May 2023 17:56:55 +0100 Subject: [PATCH] Played around with a new app structure --- .../Controllers}/ConfirmEmailController.php | 8 +- .../Controllers}/ForgotPasswordController.php | 4 +- .../Controllers}/HandlesPartialLogins.php | 6 +- .../Controllers}/LoginController.php | 6 +- .../Controllers}/MfaBackupCodesController.php | 12 +- .../Controllers}/MfaController.php | 6 +- .../Controllers}/MfaTotpController.php | 14 +- .../Controllers}/OidcController.php | 6 +- .../Controllers}/RegisterController.php | 8 +- .../Controllers}/ResetPasswordController.php | 8 +- .../Controllers}/Saml2Controller.php | 4 +- .../Controllers}/SocialController.php | 8 +- .../Controllers}/ThrottlesLogins.php | 2 +- .../Controllers}/UserInviteController.php | 6 +- .../Access/EmailConfirmationService.php | 4 +- .../Access/ExternalBaseUserProvider.php | 2 +- app/{Auth => }/Access/GroupSyncService.php | 6 +- .../Guards/AsyncExternalBaseSessionGuard.php | 2 +- .../Guards/ExternalBaseSessionGuard.php | 4 +- .../Access/Guards/LdapSessionGuard.php | 8 +- app/{Auth => }/Access/Ldap.php | 2 +- app/{Auth => }/Access/LdapService.php | 4 +- app/{Auth => }/Access/LoginService.php | 8 +- .../Access/Mfa/BackupCodeService.php | 2 +- app/{Auth => }/Access/Mfa/MfaSession.php | 4 +- app/{Auth => }/Access/Mfa/MfaValue.php | 4 +- app/{Auth => }/Access/Mfa/TotpService.php | 4 +- .../Access/Mfa/TotpValidationRule.php | 2 +- .../Access/Oidc/OidcAccessToken.php | 2 +- app/{Auth => }/Access/Oidc/OidcException.php | 2 +- app/{Auth => }/Access/Oidc/OidcIdToken.php | 2 +- .../Access/Oidc/OidcInvalidKeyException.php | 2 +- .../Access/Oidc/OidcInvalidTokenException.php | 2 +- .../Oidc/OidcIssuerDiscoveryException.php | 2 +- .../Access/Oidc/OidcJwtSigningKey.php | 2 +- .../Access/Oidc/OidcOAuthProvider.php | 2 +- .../Access/Oidc/OidcProviderSettings.php | 2 +- app/{Auth => }/Access/Oidc/OidcService.php | 10 +- app/{Auth => }/Access/RegistrationService.php | 9 +- app/{Auth => }/Access/Saml2Service.php | 4 +- app/{Auth => Access}/SocialAccount.php | 7 +- app/{Auth => }/Access/SocialAuthService.php | 6 +- app/{Auth => }/Access/UserInviteService.php | 4 +- app/{Auth => }/Access/UserTokenService.php | 4 +- app/{Actions => Activity}/ActivityQueries.php | 7 +- app/{Actions => Activity}/ActivityType.php | 2 +- app/{Actions => Activity}/CommentRepo.php | 3 +- .../Controllers/AuditLogController.php | 8 +- .../Controllers/CommentController.php | 5 +- .../Controllers/FavouriteController.php | 7 +- .../Controllers/TagController.php | 5 +- .../Controllers/WebhookController.php | 9 +- .../DispatchWebhookJob.php | 8 +- app/{Actions => Activity/Models}/Activity.php | 8 +- app/{Actions => Activity/Models}/Comment.php | 6 +- .../Models}/Favouritable.php | 2 +- .../Models}/Favourite.php | 6 +- .../Models}/Loggable.php | 2 +- app/{Actions => Activity/Models}/Tag.php | 6 +- app/{Actions => Activity/Models}/View.php | 7 +- .../Models}/Viewable.php | 2 +- app/{Actions => Activity/Models}/Webhook.php | 3 +- .../Models}/WebhookTrackedEvent.php | 2 +- .../Queries/WebhooksAllPaginatedAndSorted.php | 4 +- app/{Actions => Activity}/TagRepo.php | 5 +- .../Tools}/ActivityLogger.php | 6 +- .../Tools}/IpFormatter.php | 2 +- .../Tools}/TagClassGenerator.php | 4 +- .../Tools}/WebhookFormatter.php | 10 +- .../Api/ApiDocsController.php | 4 +- app/Api/ApiDocsGenerator.php | 2 +- app/Api/ApiToken.php | 4 +- app/Api/ApiTokenGuard.php | 2 +- .../UserApiTokenController.php | 8 +- app/{ => App}/Application.php | 2 +- app/{ => App}/Model.php | 2 +- .../Providers/AppServiceProvider.php | 6 +- .../Providers/AuthServiceProvider.php | 14 +- .../Providers/EventServiceProvider.php | 2 +- .../Providers/RouteServiceProvider.php | 2 +- .../Providers/ThemeServiceProvider.php | 2 +- .../Providers/TranslationServiceProvider.php | 2 +- .../ValidationRuleServiceProvider.php | 2 +- .../Providers/ViewTweaksServiceProvider.php | 2 +- app/{Interfaces => App}/Sluggable.php | 2 +- app/{ => App}/helpers.php | 6 +- app/Config/app.php | 16 +- app/Config/auth.php | 4 +- app/Console/Commands/ClearActivity.php | 2 +- app/Console/Commands/ClearViews.php | 2 +- app/Console/Commands/CreateAdmin.php | 4 +- app/Console/Commands/DeleteUsers.php | 4 +- .../Commands/RegenerateCommentContent.php | 4 +- .../Commands/RegeneratePermissions.php | 2 +- app/Console/Commands/ResetMfa.php | 2 +- .../Controllers}/BookApiController.php | 3 +- .../Controllers/BookController.php | 9 +- .../Controllers}/BookExportApiController.php | 3 +- .../Controllers/BookExportController.php | 3 +- .../Controllers/BookSortController.php | 5 +- .../Controllers}/BookshelfApiController.php | 3 +- .../Controllers/BookshelfController.php | 7 +- .../Controllers}/ChapterApiController.php | 3 +- .../Controllers/ChapterController.php | 5 +- .../ChapterExportApiController.php | 3 +- .../Controllers/ChapterExportController.php | 3 +- .../Controllers}/PageApiController.php | 3 +- .../Controllers/PageController.php | 5 +- .../Controllers}/PageExportApiController.php | 3 +- .../Controllers/PageExportController.php | 3 +- .../Controllers/PageRevisionController.php | 5 +- .../Controllers/PageTemplateController.php | 3 +- .../Controllers}/RecycleBinApiController.php | 3 +- .../Controllers/RecycleBinController.php | 5 +- .../Models}/Deletable.php | 2 +- app/Entities/Models/Deletion.php | 5 +- app/Entities/Models/Entity.php | 33 ++- app/Entities/Models/Page.php | 2 +- app/Entities/Models/PageRevision.php | 6 +- app/Entities/Queries/EntityQuery.php | 2 +- app/Entities/Queries/Popular.php | 2 +- app/Entities/Queries/RecentlyViewed.php | 2 +- app/Entities/Queries/TopFavourites.php | 2 +- app/Entities/Repos/BaseRepo.php | 2 +- app/Entities/Repos/BookRepo.php | 4 +- app/Entities/Repos/BookshelfRepo.php | 2 +- app/Entities/Repos/ChapterRepo.php | 2 +- app/Entities/Repos/DeletionRepo.php | 2 +- app/Entities/Repos/PageRepo.php | 2 +- app/Entities/Tools/Cloner.php | 2 +- app/Entities/Tools/HierarchyTransformer.php | 2 +- app/Entities/Tools/PermissionsUpdater.php | 8 +- app/Entities/Tools/SlugGenerator.php | 4 +- .../StoppedAuthenticationException.php | 4 +- app/Facades/Activity.php | 2 +- .../Controllers/{Api => }/ApiController.php | 3 +- app/Http/Controllers/Controller.php | 4 +- app/Http/Controllers/HomeController.php | 2 +- .../Middleware/AuthenticatedOrPendingMfa.php | 4 +- app/Http/Middleware/CheckEmailConfirmed.php | 4 +- app/Http/Middleware/Localization.php | 2 +- .../Middleware/RedirectIfAuthenticated.php | 2 +- app/Http/Requests/Request.php | 10 - app/Notifications/UserInvite.php | 2 +- .../ContentPermissionApiController.php | 3 +- .../Permissions/EntityPermissionEvaluator.php | 5 +- .../Permissions/JointPermissionBuilder.php | 5 +- .../MassEntityPermissionEvaluator.php | 4 +- .../Models}/EntityPermission.php | 6 +- .../Models}/JointPermission.php | 6 +- .../Models}/RolePermission.php | 6 +- .../Permissions/PermissionApplicator.php | 13 +- .../Permissions/PermissionFormData.php | 5 +- .../Permissions/PermissionStatus.php | 2 +- .../PermissionsController.php | 8 +- .../Permissions/PermissionsRepo.php | 7 +- .../Permissions/SimpleEntityData.php | 2 +- app/References/CrossLinkParser.php | 2 +- .../ModelResolvers/BookLinkModelResolver.php | 2 +- .../BookshelfLinkModelResolver.php | 2 +- .../ChapterLinkModelResolver.php | 2 +- .../ModelResolvers/CrossLinkModelResolver.php | 2 +- .../ModelResolvers/PageLinkModelResolver.php | 2 +- .../PagePermalinkModelResolver.php | 2 +- app/References/Reference.php | 2 +- .../ReferenceController.php | 4 +- app/References/ReferenceFetcher.php | 2 +- .../Api => Search}/SearchApiController.php | 6 +- .../SearchController.php | 6 +- app/Search/SearchIndex.php | 2 +- app/Search/SearchResultsFormatter.php | 2 +- app/Search/SearchRunner.php | 4 +- app/Search/SearchTerm.php | 2 +- .../MaintenanceController.php | 5 +- app/Settings/Setting.php | 2 +- .../SettingController.php | 9 +- app/Settings/SettingService.php | 2 +- .../StatusController.php | 3 +- app/Theming/ThemeEvents.php | 14 +- app/Theming/ThemeService.php | 2 +- app/{Util => Translation}/LanguageManager.php | 2 +- app/Uploads/Attachment.php | 10 +- .../Controllers}/AttachmentApiController.php | 3 +- .../Controllers/AttachmentController.php | 3 +- .../Controllers}/DrawioImageController.php | 2 +- .../Controllers}/GalleryImageController.php | 2 +- .../Controllers}/ImageController.php | 2 +- .../ImageGalleryApiController.php | 3 +- app/Uploads/Image.php | 8 +- app/Uploads/ImageRepo.php | 2 +- app/Uploads/UserAvatars.php | 2 +- .../Controllers}/RoleApiController.php | 7 +- .../Controllers/RoleController.php | 10 +- .../Controllers}/UserApiController.php | 7 +- .../Controllers/UserController.php | 11 +- .../Controllers/UserPreferencesController.php | 5 +- .../Controllers/UserProfileController.php | 11 +- .../Controllers/UserSearchController.php | 5 +- .../Models}/HasCreatorAndUpdater.php | 3 +- app/{Traits => Users/Models}/HasOwner.php | 3 +- app/{Auth => Users/Models}/Role.php | 12 +- app/{Auth => Users/Models}/User.php | 13 +- .../Queries/RolesAllPaginatedAndSorted.php | 4 +- .../Queries/UserContentCounts.php | 4 +- .../Queries/UserRecentlyCreatedContent.php | 4 +- .../Queries/UsersAllPaginatedAndSorted.php | 4 +- app/{Auth => Users}/UserRepo.php | 8 +- bootstrap/app.php | 2 +- composer.json | 2 +- database/factories/Actions/CommentFactory.php | 2 +- database/factories/Actions/TagFactory.php | 2 +- database/factories/Actions/WebhookFactory.php | 2 +- .../Actions/WebhookTrackedEventFactory.php | 4 +- database/factories/Auth/RoleFactory.php | 2 +- database/factories/Auth/UserFactory.php | 2 +- .../factories/Uploads/AttachmentFactory.php | 2 +- ...625_refactor_joint_permissions_storage.php | 2 +- database/seeders/DummyContentSeeder.php | 8 +- database/seeders/LargeContentSeeder.php | 6 +- .../views/entities/body-tag-classes.blade.php | 2 +- .../views/form/entity-permissions.blade.php | 5 +- resources/views/settings/audit.blade.php | 206 +++++++++--------- .../views/settings/registration.blade.php | 16 +- .../settings/webhooks/parts/form.blade.php | 2 +- resources/views/tags/index.blade.php | 2 +- routes/api.php | 30 +-- routes/web.php | 153 +++++++------ tests/Actions/AuditLogTest.php | 8 +- tests/Actions/WebhookCallTest.php | 10 +- tests/Actions/WebhookFormatTesting.php | 6 +- tests/Actions/WebhookManagementTest.php | 4 +- tests/Api/ApiAuthTest.php | 6 +- tests/Api/RolesApiTest.php | 6 +- tests/Api/TestsApi.php | 2 +- tests/Api/UsersApiTest.php | 6 +- tests/Auth/AuthTest.php | 2 +- tests/Auth/GroupSyncServiceTest.php | 6 +- tests/Auth/LdapTest.php | 8 +- tests/Auth/MfaConfigurationTest.php | 8 +- tests/Auth/MfaVerificationTest.php | 10 +- tests/Auth/OidcTest.php | 6 +- tests/Auth/RegistrationTest.php | 4 +- tests/Auth/ResetPasswordTest.php | 2 +- tests/Auth/Saml2Test.php | 4 +- tests/Auth/SocialAuthTest.php | 6 +- tests/Auth/UserInviteTest.php | 4 +- tests/Commands/ClearActivityCommandTest.php | 2 +- tests/Commands/CreateAdminCommandTest.php | 2 +- .../RegenerateCommentContentCommandTest.php | 2 +- .../RegeneratePermissionsCommandTest.php | 3 +- tests/Commands/ResetMfaCommandTest.php | 4 +- tests/DebugViewTest.php | 2 +- tests/Entity/BookShelfTest.php | 2 +- tests/Entity/CommentTest.php | 2 +- tests/Entity/ConvertTest.php | 4 +- tests/Entity/EntityAccessTest.php | 2 +- tests/Entity/EntitySearchTest.php | 2 +- tests/Entity/ExportTest.php | 1 - tests/Entity/PageRevisionTest.php | 2 +- tests/Entity/TagTest.php | 2 +- tests/FavouriteTest.php | 4 +- tests/Helpers/EntityProvider.php | 2 +- tests/Helpers/PermissionsProvider.php | 8 +- tests/Helpers/UserRoleProvider.php | 6 +- tests/HomepageTest.php | 4 +- tests/Permissions/EntityOwnerChangeTest.php | 2 +- tests/Permissions/EntityPermissionsTest.php | 4 +- tests/Permissions/RolesTest.php | 8 +- .../Scenarios/PermissionScenarioTestCase.php | 2 +- tests/PublicActionTest.php | 6 +- tests/References/ReferencesTest.php | 2 +- tests/Settings/RegenerateReferencesTest.php | 2 +- tests/ThemeTest.php | 8 +- tests/Unit/IpFormatterTest.php | 2 +- tests/Unit/OidcIdTokenTest.php | 4 +- tests/Uploads/AvatarTest.php | 2 +- tests/User/UserApiTokenTest.php | 2 +- tests/User/UserManagementTest.php | 8 +- tests/User/UserProfileTest.php | 4 +- tests/User/UserSearchTest.php | 2 +- 280 files changed, 839 insertions(+), 789 deletions(-) rename app/{Http/Controllers/Auth => Access/Controllers}/ConfirmEmailController.php (95%) rename app/{Http/Controllers/Auth => Access/Controllers}/ForgotPasswordController.php (96%) rename app/{Http/Controllers/Auth => Access/Controllers}/HandlesPartialLogins.php (81%) rename app/{Http/Controllers/Auth => Access/Controllers}/LoginController.php (98%) rename app/{Http/Controllers/Auth => Access/Controllers}/MfaBackupCodesController.php (92%) rename app/{Http/Controllers/Auth => Access/Controllers}/MfaController.php (94%) rename app/{Http/Controllers/Auth => Access/Controllers}/MfaTotpController.php (90%) rename app/{Http/Controllers/Auth => Access/Controllers}/OidcController.php (92%) rename app/{Http/Controllers/Auth => Access/Controllers}/RegisterController.php (93%) rename app/{Http/Controllers/Auth => Access/Controllers}/ResetPasswordController.php (95%) rename app/{Http/Controllers/Auth => Access/Controllers}/Saml2Controller.php (97%) rename app/{Http/Controllers/Auth => Access/Controllers}/SocialController.php (96%) rename app/{Http/Controllers/Auth => Access/Controllers}/ThrottlesLogins.php (98%) rename app/{Http/Controllers/Auth => Access/Controllers}/UserInviteController.php (95%) rename app/{Auth => }/Access/EmailConfirmationService.php (94%) rename app/{Auth => }/Access/ExternalBaseUserProvider.php (98%) rename app/{Auth => }/Access/GroupSyncService.php (96%) rename app/{Auth => }/Access/Guards/AsyncExternalBaseSessionGuard.php (95%) rename app/{Auth => }/Access/Guards/ExternalBaseSessionGuard.php (98%) rename app/{Auth => }/Access/Guards/LdapSessionGuard.php (96%) rename app/{Auth => }/Access/Ldap.php (99%) rename app/{Auth => }/Access/LdapService.php (99%) rename app/{Auth => }/Access/LoginService.php (97%) rename app/{Auth => }/Access/Mfa/BackupCodeService.php (97%) rename app/{Auth => }/Access/Mfa/MfaSession.php (95%) rename app/{Auth => }/Access/Mfa/MfaValue.php (96%) rename app/{Auth => }/Access/Mfa/TotpService.php (96%) rename app/{Auth => }/Access/Mfa/TotpValidationRule.php (95%) rename app/{Auth => }/Access/Oidc/OidcAccessToken.php (97%) rename app/{Auth => }/Access/Oidc/OidcException.php (63%) rename app/{Auth => }/Access/Oidc/OidcIdToken.php (99%) rename app/{Auth => }/Access/Oidc/OidcInvalidKeyException.php (61%) rename app/{Auth => }/Access/Oidc/OidcInvalidTokenException.php (67%) rename app/{Auth => }/Access/Oidc/OidcIssuerDiscoveryException.php (68%) rename app/{Auth => }/Access/Oidc/OidcJwtSigningKey.php (99%) rename app/{Auth => }/Access/Oidc/OidcOAuthProvider.php (99%) rename app/{Auth => }/Access/Oidc/OidcProviderSettings.php (99%) rename app/{Auth => }/Access/Oidc/OidcService.php (97%) rename app/{Auth => }/Access/RegistrationService.php (96%) rename app/{Auth => }/Access/Saml2Service.php (99%) rename app/{Auth => Access}/SocialAccount.php (79%) rename app/{Auth => }/Access/SocialAuthService.php (99%) rename app/{Auth => }/Access/UserInviteService.php (89%) rename app/{Auth => }/Access/UserTokenService.php (97%) rename app/{Actions => Activity}/ActivityQueries.php (95%) rename app/{Actions => Activity}/ActivityType.php (98%) rename app/{Actions => Activity}/CommentRepo.php (97%) rename app/{Http => Activity}/Controllers/AuditLogController.php (92%) rename app/{Http => Activity}/Controllers/CommentController.php (94%) rename app/{Http => Activity}/Controllers/FavouriteController.php (94%) rename app/{Http => Activity}/Controllers/TagController.php (93%) rename app/{Http => Activity}/Controllers/WebhookController.php (94%) rename app/{Actions => Activity}/DispatchWebhookJob.php (92%) rename app/{Actions => Activity/Models}/Activity.php (92%) rename app/{Actions => Activity/Models}/Comment.php (91%) rename app/{Interfaces => Activity/Models}/Favouritable.php (84%) rename app/{Actions => Activity/Models}/Favourite.php (84%) rename app/{Interfaces => Activity/Models}/Loggable.php (79%) rename app/{Actions => Activity/Models}/Tag.php (92%) rename app/{Actions => Activity/Models}/View.php (92%) rename app/{Interfaces => Activity/Models}/Viewable.php (84%) rename app/{Actions => Activity/Models}/Webhook.php (97%) rename app/{Actions => Activity/Models}/WebhookTrackedEvent.php (88%) rename app/{Actions => Activity}/Queries/WebhooksAllPaginatedAndSorted.php (91%) rename app/{Actions => Activity}/TagRepo.php (97%) rename app/{Actions => Activity/Tools}/ActivityLogger.php (95%) rename app/{Actions => Activity/Tools}/IpFormatter.php (98%) rename app/{Actions => Activity/Tools}/TagClassGenerator.php (93%) rename app/{Actions => Activity/Tools}/WebhookFormatter.php (94%) rename app/{Http/Controllers => }/Api/ApiDocsController.php (88%) rename app/{Http/Controllers => Api}/UserApiTokenController.php (97%) rename app/{ => App}/Application.php (95%) rename app/{ => App}/Model.php (94%) rename app/{ => App}/Providers/AppServiceProvider.php (94%) rename app/{ => App}/Providers/AuthServiceProvider.php (84%) rename app/{ => App}/Providers/EventServiceProvider.php (97%) rename app/{ => App}/Providers/RouteServiceProvider.php (98%) rename app/{ => App}/Providers/ThemeServiceProvider.php (95%) rename app/{ => App}/Providers/TranslationServiceProvider.php (97%) rename app/{ => App}/Providers/ValidationRuleServiceProvider.php (96%) rename app/{ => App}/Providers/ViewTweaksServiceProvider.php (95%) rename app/{Interfaces => App}/Sluggable.php (89%) rename app/{ => App}/helpers.php (97%) rename app/{Http/Controllers/Api => Entities/Controllers}/BookApiController.php (97%) rename app/{Http => Entities}/Controllers/BookController.php (97%) rename app/{Http/Controllers/Api => Entities/Controllers}/BookExportApiController.php (95%) rename app/{Http => Entities}/Controllers/BookExportController.php (95%) rename app/{Http => Entities}/Controllers/BookSortController.php (94%) rename app/{Http/Controllers/Api => Entities/Controllers}/BookshelfApiController.php (97%) rename app/{Http => Entities}/Controllers/BookshelfController.php (97%) rename app/{Http/Controllers/Api => Entities/Controllers}/ChapterApiController.php (97%) rename app/{Http => Entities}/Controllers/ChapterController.php (98%) rename app/{Http/Controllers/Api => Entities/Controllers}/ChapterExportApiController.php (95%) rename app/{Http => Entities}/Controllers/ChapterExportController.php (96%) rename app/{Http/Controllers/Api => Entities/Controllers}/PageApiController.php (98%) rename app/{Http => Entities}/Controllers/PageController.php (99%) rename app/{Http/Controllers/Api => Entities/Controllers}/PageExportApiController.php (95%) rename app/{Http => Entities}/Controllers/PageExportController.php (96%) rename app/{Http => Entities}/Controllers/PageRevisionController.php (97%) rename app/{Http => Entities}/Controllers/PageTemplateController.php (93%) rename app/{Http/Controllers/Api => Entities/Controllers}/RecycleBinApiController.php (97%) rename app/{Http => Entities}/Controllers/RecycleBinController.php (96%) rename app/{Interfaces => Entities/Models}/Deletable.php (87%) rename app/Http/Controllers/{Api => }/ApiController.php (93%) delete mode 100644 app/Http/Requests/Request.php rename app/{Http/Controllers/Api => Permissions}/ContentPermissionApiController.php (98%) rename app/{Auth => }/Permissions/EntityPermissionEvaluator.php (97%) rename app/{Auth => }/Permissions/JointPermissionBuilder.php (98%) rename app/{Auth => }/Permissions/MassEntityPermissionEvaluator.php (96%) rename app/{Auth/Permissions => Permissions/Models}/EntityPermission.php (90%) rename app/{Auth/Permissions => Permissions/Models}/JointPermission.php (85%) rename app/{Auth/Permissions => Permissions/Models}/RolePermission.php (86%) rename app/{Auth => }/Permissions/PermissionApplicator.php (96%) rename app/{Auth => }/Permissions/PermissionFormData.php (93%) rename app/{Auth => }/Permissions/PermissionStatus.php (80%) rename app/{Http/Controllers => Permissions}/PermissionsController.php (97%) rename app/{Auth => }/Permissions/PermissionsRepo.php (96%) rename app/{Auth => }/Permissions/SimpleEntityData.php (94%) rename app/{Http/Controllers => References}/ReferenceController.php (96%) rename app/{Http/Controllers/Api => Search}/SearchApiController.php (93%) rename app/{Http/Controllers => Search}/SearchController.php (96%) rename app/{Http/Controllers => Settings}/MaintenanceController.php (96%) rename app/{Http/Controllers => Settings}/SettingController.php (91%) rename app/{Http/Controllers => Settings}/StatusController.php (94%) rename app/{Util => Translation}/LanguageManager.php (99%) rename app/{Http/Controllers/Api => Uploads/Controllers}/AttachmentApiController.php (98%) rename app/{Http => Uploads}/Controllers/AttachmentController.php (99%) rename app/{Http/Controllers/Images => Uploads/Controllers}/DrawioImageController.php (98%) rename app/{Http/Controllers/Images => Uploads/Controllers}/GalleryImageController.php (97%) rename app/{Http/Controllers/Images => Uploads/Controllers}/ImageController.php (98%) rename app/{Http/Controllers/Api => Uploads/Controllers}/ImageGalleryApiController.php (98%) rename app/{Http/Controllers/Api => Users/Controllers}/RoleApiController.php (96%) rename app/{Http => Users}/Controllers/RoleController.php (95%) rename app/{Http/Controllers/Api => Users/Controllers}/UserApiController.php (97%) rename app/{Http => Users}/Controllers/UserController.php (96%) rename app/{Http => Users}/Controllers/UserPreferencesController.php (97%) rename app/{Http => Users}/Controllers/UserProfileController.php (74%) rename app/{Http => Users}/Controllers/UserSearchController.php (88%) rename app/{Traits => Users/Models}/HasCreatorAndUpdater.php (90%) rename app/{Traits => Users/Models}/HasOwner.php (84%) rename app/{Auth => Users/Models}/Role.php (92%) rename app/{Auth => Users/Models}/User.php (97%) rename app/{Auth => Users}/Queries/RolesAllPaginatedAndSorted.php (93%) rename app/{Auth => Users}/Queries/UserContentCounts.php (91%) rename app/{Auth => Users}/Queries/UserRecentlyCreatedContent.php (93%) rename app/{Auth => Users}/Queries/UsersAllPaginatedAndSorted.php (94%) rename app/{Auth => Users}/UserRepo.php (97%) diff --git a/app/Http/Controllers/Auth/ConfirmEmailController.php b/app/Access/Controllers/ConfirmEmailController.php similarity index 95% rename from app/Http/Controllers/Auth/ConfirmEmailController.php rename to app/Access/Controllers/ConfirmEmailController.php index fdde8e70c..3fda0586e 100644 --- a/app/Http/Controllers/Auth/ConfirmEmailController.php +++ b/app/Access/Controllers/ConfirmEmailController.php @@ -1,14 +1,14 @@ [ 'users' => [ 'driver' => 'eloquent', - 'model' => \BookStack\Auth\User::class, + 'model' => \BookStack\Users\Models\User::class, ], 'external' => [ 'driver' => 'external-users', - 'model' => \BookStack\Auth\User::class, + 'model' => \BookStack\Users\Models\User::class, ], // 'users' => [ diff --git a/app/Console/Commands/ClearActivity.php b/app/Console/Commands/ClearActivity.php index 932ba7ddd..5ccf6e972 100644 --- a/app/Console/Commands/ClearActivity.php +++ b/app/Console/Commands/ClearActivity.php @@ -2,7 +2,7 @@ namespace BookStack\Console\Commands; -use BookStack\Actions\Activity; +use BookStack\Activity\Models\Activity; use Illuminate\Console\Command; class ClearActivity extends Command diff --git a/app/Console/Commands/ClearViews.php b/app/Console/Commands/ClearViews.php index 0fc6c0195..c76b78d23 100644 --- a/app/Console/Commands/ClearViews.php +++ b/app/Console/Commands/ClearViews.php @@ -2,7 +2,7 @@ namespace BookStack\Console\Commands; -use BookStack\Actions\View; +use BookStack\Activity\Models\View; use Illuminate\Console\Command; class ClearViews extends Command diff --git a/app/Console/Commands/CreateAdmin.php b/app/Console/Commands/CreateAdmin.php index e4660314d..377207ed7 100644 --- a/app/Console/Commands/CreateAdmin.php +++ b/app/Console/Commands/CreateAdmin.php @@ -2,9 +2,9 @@ namespace BookStack\Console\Commands; -use BookStack\Auth\Role; -use BookStack\Auth\UserRepo; use BookStack\Exceptions\NotFoundException; +use BookStack\Users\Models\Role; +use BookStack\Users\UserRepo; use Illuminate\Console\Command; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Str; diff --git a/app/Console/Commands/DeleteUsers.php b/app/Console/Commands/DeleteUsers.php index bc7263c77..c16a5d9a6 100644 --- a/app/Console/Commands/DeleteUsers.php +++ b/app/Console/Commands/DeleteUsers.php @@ -2,8 +2,8 @@ namespace BookStack\Console\Commands; -use BookStack\Auth\User; -use BookStack\Auth\UserRepo; +use BookStack\Users\Models\User; +use BookStack\Users\UserRepo; use Illuminate\Console\Command; class DeleteUsers extends Command diff --git a/app/Console/Commands/RegenerateCommentContent.php b/app/Console/Commands/RegenerateCommentContent.php index 3e25dc8a3..3052559e3 100644 --- a/app/Console/Commands/RegenerateCommentContent.php +++ b/app/Console/Commands/RegenerateCommentContent.php @@ -2,8 +2,8 @@ namespace BookStack\Console\Commands; -use BookStack\Actions\Comment; -use BookStack\Actions\CommentRepo; +use BookStack\Activity\CommentRepo; +use BookStack\Activity\Models\Comment; use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; diff --git a/app/Console/Commands/RegeneratePermissions.php b/app/Console/Commands/RegeneratePermissions.php index efb3535d6..27dd8ea65 100644 --- a/app/Console/Commands/RegeneratePermissions.php +++ b/app/Console/Commands/RegeneratePermissions.php @@ -2,7 +2,7 @@ namespace BookStack\Console\Commands; -use BookStack\Auth\Permissions\JointPermissionBuilder; +use BookStack\Permissions\JointPermissionBuilder; use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; diff --git a/app/Console/Commands/ResetMfa.php b/app/Console/Commands/ResetMfa.php index 9074a4a46..4b1813099 100644 --- a/app/Console/Commands/ResetMfa.php +++ b/app/Console/Commands/ResetMfa.php @@ -2,7 +2,7 @@ namespace BookStack\Console\Commands; -use BookStack\Auth\User; +use BookStack\Users\Models\User; use Illuminate\Console\Command; class ResetMfa extends Command diff --git a/app/Http/Controllers/Api/BookApiController.php b/app/Entities/Controllers/BookApiController.php similarity index 97% rename from app/Http/Controllers/Api/BookApiController.php rename to app/Entities/Controllers/BookApiController.php index d57b48a43..5abac12fb 100644 --- a/app/Http/Controllers/Api/BookApiController.php +++ b/app/Entities/Controllers/BookApiController.php @@ -1,6 +1,6 @@ tags->all()))->generateAsString() . ' ')) \ No newline at end of file +@push('body-class', e((new \BookStack\Activity\Tools\TagClassGenerator($entity->tags->all()))->generateAsString() . ' ')) \ No newline at end of file diff --git a/resources/views/form/entity-permissions.blade.php b/resources/views/form/entity-permissions.blade.php index 9bf309fb8..8eddac8de 100644 --- a/resources/views/form/entity-permissions.blade.php +++ b/resources/views/form/entity-permissions.blade.php @@ -1,5 +1,5 @@
- + - @endforeach + @foreach(request()->only(['order', 'sort']) as $key => $val) + + @endforeach - - - @if(!empty($filters['event'])) - - @endif - - @foreach(['date_from', 'date_to'] as $filterKey) -
- - + - @endforeach -
- - @include('form.user-select', ['user' => $filters['user'] ? \BookStack\Auth\User::query()->find($filters['user']) : null, 'name' => 'user']) -
+ @if(!empty($filters['event'])) + + @endif + + @foreach(['date_from', 'date_to'] as $filterKey) +
+ + +
+ @endforeach + +
+ + @include('form.user-select', ['user' => $filters['user'] ? \BookStack\Users\Models\User::query()->find($filters['user']) : null, 'name' => 'user']) +
-
- - @include('form.text', ['name' => 'ip', 'model' => (object) $filters]) - -
- +
+ + @include('form.text', ['name' => 'ip', 'model' => (object) $filters]) + +
+ -
+
-
-
{{ $activities->links() }}
-
- @include('common.sort', array_merge($listOptions->getSortControlData(), ['useQuery' => true])) -
-
- -
-
-
{{ trans('settings.audit_table_user') }}
-
{{ trans('settings.audit_table_event') }}
-
{{ trans('settings.audit_table_related') }}
-
-
{{ trans('settings.audit_table_ip') }}
-
{{ trans('settings.audit_table_date') }}
+
+
{{ $activities->links() }}
+
+ @include('common.sort', array_merge($listOptions->getSortControlData(), ['useQuery' => true]))
- @foreach($activities as $activity) -
-
- @include('settings.parts.table-user', ['user' => $activity->user, 'user_id' => $activity->user_id]) -
-
{{ trans('settings.audit_table_event') }}: {{ $activity->type }}
-
- @if($activity->entity) - - @icon($activity->entity->getType()) -
- {{ $activity->entity->name }} -
-
- @elseif($activity->detail && $activity->isForEntity()) -
- {{ trans('settings.audit_deleted_item') }}
- {{ trans('settings.audit_deleted_item_name', ['name' => $activity->detail]) }} -
- @elseif($activity->detail) -
{{ $activity->detail }}
- @endif -
+ +
+
+
{{ trans('settings.audit_table_user') }}
+
{{ trans('settings.audit_table_event') }}
+
{{ trans('settings.audit_table_related') }}
-
{{ trans('settings.audit_table_ip') }}:
{{ $activity->ip }}
-
{{ trans('settings.audit_table_date') }}:
{{ $activity->created_at }}
+
{{ trans('settings.audit_table_ip') }}
+
{{ trans('settings.audit_table_date') }}
- @endforeach + @foreach($activities as $activity) +
+
+ @include('settings.parts.table-user', ['user' => $activity->user, 'user_id' => $activity->user_id]) +
+
{{ trans('settings.audit_table_event') }} + : {{ $activity->type }}
+
+ @if($activity->entity) + + @icon($activity->entity->getType()) +
+ {{ $activity->entity->name }} +
+
+ @elseif($activity->detail && $activity->isForEntity()) +
+ {{ trans('settings.audit_deleted_item') }}
+ {{ trans('settings.audit_deleted_item_name', ['name' => $activity->detail]) }} +
+ @elseif($activity->detail) +
{{ $activity->detail }}
+ @endif +
+
+
{{ trans('settings.audit_table_ip') }} + :
{{ $activity->ip }}
+
{{ trans('settings.audit_table_date') }} + :
{{ $activity->created_at }}
+
+
+ @endforeach +
+ +
+ {{ $activities->links() }} +
-
- {{ $activities->links() }} -
- -
@stop diff --git a/resources/views/settings/registration.blade.php b/resources/views/settings/registration.blade.php index e60704aeb..1666cef53 100644 --- a/resources/views/settings/registration.blade.php +++ b/resources/views/settings/registration.blade.php @@ -24,9 +24,12 @@ @endif - has('setting-registration-role')) class="neg" @endif> + + @foreach(\BookStack\Users\Models\Role::all() as $role)