From ccd7e53c823303a2e22b1af8eb9edfac78f34060 Mon Sep 17 00:00:00 2001 From: Stefan Hagspiel Date: Fri, 22 Sep 2023 21:26:05 +0200 Subject: [PATCH] Pimcore 11 Support --- .actrc | 1 - .../classes/class_MembersGroup_export.json | 0 .../classes/class_MembersUser_export.json | 0 .../classes/class_SsoIdentity_export.json | 0 .../install/emails-Members.json | 0 .../install/sql/install.sql | 0 .../install/translations/admin.csv | 0 .../install/translations/frontend.csv | 0 .../config/oauth.yml => config/oauth.yaml | 0 .../packages/security_auth_manager.yaml | 0 .../packages/security_legacy.yaml | 0 .../config.yml => config/pimcore/config.yaml | 0 .../pimcore/routing.yaml | 0 .../pimcore/routing/all.yaml | 0 .../pimcore/routing/auth.yaml | 0 .../pimcore/routing/change_password.yaml | 0 .../pimcore/routing/delete_account.yaml | 0 .../pimcore/routing/oauth.yaml | 0 .../pimcore/routing/profile.yaml | 0 .../pimcore/routing/registration.yaml | 0 .../pimcore/routing/resetting.yaml | 0 .../security.yaml | 0 .../services.yml => config/services.yaml | 0 .../_alias.yml => config/services/_alias.yaml | 0 .../area.yml => config/services/area.yaml | 0 .../services/change_password.yaml | 0 .../services/commands.yaml | 0 .../services/configuration.yaml | 0 .../services/delete_account.yaml | 0 .../event.yml => config/services/event.yaml | 0 .../mail.yml => config/services/mail.yaml | 0 .../services/manager.yaml | 0 .../services/oauth/controller.yaml | 0 .../services/oauth/event.yaml | 0 .../services/oauth/form.yaml | 0 .../services/oauth/mainentance.yaml | 0 .../services/oauth/manager.yaml | 0 .../services/oauth/processor.yaml | 0 .../services/oauth/security.yaml | 0 .../services/oauth/service.yaml | 0 .../services/oauth/session.yaml | 0 .../services/oauth/twig.yaml | 0 .../services/options_provider.yaml | 0 .../services/profile.yaml | 0 .../services/registration.yaml | 0 .../services/registry.yaml | 0 .../services/resetting.yaml | 0 .../services/restriction.yaml | 0 .../services/security.yaml | 0 .../services/services.yaml | 0 .../services/session.yaml | 0 .../system.yml => config/services/system.yaml | 2 +- .../tool.yml => config/services/tool.yaml | 0 .../twig.yml => config/services/twig.yaml | 0 .../services/validator.yaml | 0 .../User.yml => config/validation/User.yaml | 0 .../public => public}/css/admin-editmode.css | 0 .../Resources/public => public}/css/admin.css | 0 .../Resources/public => public}/img/group.svg | 0 .../Resources/public => public}/img/lock.svg | 0 .../public => public}/img/members.svg | 0 .../public => public}/img/objectGroup.svg | 0 .../public => public}/img/objectUser.svg | 0 .../public => public}/img/tree_lock.png | Bin .../img/tree_lock_inherit.png | Bin .../js/backend/document/restriction.js | 0 .../public => public}/js/backend/startup.js | 2 +- .../js/coreExtension/data/dataMultiselect.js | 0 .../data/membersGroupMultiselect.js | 0 .../tags/membersGroupMultiselect.js | 0 .../js/coreExtension/tags/multiselect.js | 0 .../Adapter/Group/AbstractGroup.php | 0 .../Adapter/Group/GroupInterface.php | 0 .../Adapter/Group/GroupTrait.php | 0 .../Adapter/Sso/AbstractSSoIdentity.php | 0 .../Adapter/Sso/SsoIdentityInterface.php | 0 .../Adapter/User/AbstractCustomerUser.php | 0 .../Adapter/User/AbstractSsoAwareUser.php | 0 .../Adapter/User/AbstractUser.php | 0 .../Adapter/User/SsoAwareUserInterface.php | 7 +- src/Adapter/User/UserInterface.php | 81 ++++++++ .../Adapter/User/UserTrait.php | 0 .../Command/ClassInstallerCommand.php | 0 .../Command/OAuthSetupCommand.php | 0 src/Configuration/Configuration.php | 28 +++ .../Controller/AbstractController.php | 0 .../Admin/RestrictionController.php | 4 +- .../Controller/AuthController.php | 2 +- .../Controller/ChangePasswordController.php | 4 +- .../Controller/DeleteAccountController.php | 4 +- .../Controller/EmailController.php | 0 .../Controller/OAuthController.php | 33 +--- .../Controller/ProfileController.php | 4 +- .../Controller/RegistrationController.php | 33 +--- .../Controller/RequestController.php | 0 .../Controller/ResettingController.php | 6 +- .../CoreExtension/GroupMultiselect.php | 171 +++++------------ .../Provider/RoleOptionsProvider.php | 22 +-- .../CompilerPass/OAuthLoginStrategyPass.php | 0 .../DependencyInjection/Configuration.php | 0 .../DependencyInjection/MembersExtension.php | 63 +------ .../Areabrick/MembersLogin/MembersLogin.php | 13 +- .../Document/Builder/BrickBuilder.php | 0 .../Event/FilterUserResponseEvent.php | 0 src/{MembersBundle => }/Event/FormEvent.php | 0 .../Event/GetResponseNullableUserEvent.php | 0 .../Event/GetResponseUserEvent.php | 0 .../Event/OAuth/OAuthIdentityEvent.php | 0 .../Event/OAuth/OAuthResourceEvent.php | 0 .../Event/OAuth/OAuthResponseEvent.php | 0 .../Event/RestrictionEvent.php | 0 .../Event/StaticRouteEvent.php | 0 src/{MembersBundle => }/Event/UserEvent.php | 0 src/EventListener/Admin/AssetListener.php | 45 +++++ .../AssetFrontendPathListener.php | 0 .../EventListener/AuthenticationListener.php | 0 .../EventListener/FlashListener.php | 28 +-- .../EventListener/ForbiddenRouteListener.php | 0 .../Frontend/HeadMetaListener.php | 0 .../EventListener/LastLoginListener.php | 0 .../SsoCleanUpExpiredTokenListener.php | 0 .../MembersCompletenessListener.php | 16 +- .../OAuthRegistrationListener.php | 0 .../PostConfirmationListener.php | 50 +++-- .../EventListener/ResettingListener.php | 0 .../RestrictionStoreListener.php | 0 .../EventListener/TreeListener.php | 3 +- .../EventListener/UserChangeListener.php | 0 ...egistrationAuthIdentifierTypeExtension.php | 0 .../Extension/RegistrationTypeExtension.php | 0 .../Form/Factory/FactoryInterface.php | 0 .../Form/Factory/FormFactory.php | 0 .../Form/Type/ChangePasswordFormType.php | 0 .../Form/Type/DeleteAccountFormType.php | 0 .../Form/Type/LoginFormType.php | 0 .../Form/Type/ProfileFormType.php | 0 .../Form/Type/RegistrationFormType.php | 0 .../Form/Type/ResettingFormType.php | 0 .../Form/Type/ResettingRequestFormType.php | 0 .../Form/Type/Sso/CompleteProfileFormType.php | 0 src/{MembersBundle => }/Mailer/Mailer.php | 0 .../Mailer/MailerInterface.php | 0 .../Manager/ClassManager.php | 0 .../Manager/ClassManagerInterface.php | 0 .../Manager/LoginManager.php | 0 .../Manager/LoginManagerInterface.php | 0 .../Manager/RestrictionManager.php | 0 .../Manager/RestrictionManagerInterface.php | 0 .../Manager/SsoIdentityManager.php | 0 .../Manager/SsoIdentityManagerInterface.php | 0 .../Manager/UserManager.php | 0 .../Manager/UserManagerInterface.php | 0 src/{MembersBundle => }/MembersBundle.php | 31 +-- .../Adapter/User/UserInterface.php | 163 ---------------- .../Configuration/Configuration.php | 47 ----- .../Resources/config/security_legacy.yml | 5 - .../Factory/UserAwareEncoderFactory.php | 12 -- .../Security/OAuthIdentityAuthenticator.php | 177 ------------------ .../Session/SessionConfigurator.php | 20 -- src/{MembersBundle => }/MembersEvents.php | 0 src/{MembersBundle => }/Migrations/.gitkeep | 0 .../Registry/OAuthLoginProcessorRegistry.php | 0 .../OAuthLoginProcessorRegistryInterface.php | 0 src/{MembersBundle => }/Restriction/Dao.php | 35 ++-- .../Restriction/ElementRestriction.php | 0 .../Restriction/Restriction.php | 0 .../OAuthIdentityAuthenticator.php | 10 +- .../Security/OAuth/AccountConnector.php | 0 .../OAuth/AccountConnectorInterface.php | 0 .../OAuth/Dispatcher/ConnectDispatcher.php | 0 .../OAuth/Dispatcher/DispatcherInterface.php | 0 .../OAuth/Dispatcher/LoginDispatcher.php | 0 .../CompleteProfileProcessor.php | 5 +- .../LoginProcessor/InstantProcessor.php | 5 +- .../LoginProcessorInterface.php | 0 .../Dispatcher/Router/DispatchRouter.php | 0 .../Exception/AccountNotLinkedException.php | 0 .../OAuth/OAuthRegistrationHandler.php | 0 .../Security/OAuth/OAuthResponse.php | 0 .../Security/OAuth/OAuthResponseInterface.php | 0 .../Security/OAuth/OAuthScopeAllocator.php | 0 .../OAuth/OAuthScopeAllocatorInterface.php | 0 .../Security/OAuth/OAuthTokenStorage.php | 26 ++- .../OAuth/OAuthTokenStorageInterface.php | 0 .../Security/RestrictionQuery.php | 2 +- .../Security/RestrictionUri.php | 0 .../Security/UserChecker.php | 0 .../Security/UserProvider.php | 0 ...questPropertiesForUserExtractorService.php | 0 ...ertiesForUserExtractorServiceInterface.php | 0 .../Service/ResourceMappingService.php | 0 .../Service/RestrictionService.php | 4 +- .../Service/SsoIdentityStatusService.php | 0 .../SsoIdentityStatusServiceInterface.php | 0 src/Session/SessionConfigurator.php | 40 ++++ .../Tool/ClassInstaller.php | 0 src/{MembersBundle => }/Tool/Install.php | 8 +- .../Tool/TokenGenerator.php | 0 .../Tool/TokenGeneratorInterface.php | 0 .../Twig/Extension/NavigationExtension.php | 0 .../Twig/Extension/OAuthExtension.php | 0 .../Extension/RestrictionUriExtension.php | 0 .../Twig/Extension/SystemExtension.php | 0 .../RegistrationValidationGroupResolver.php | 20 +- .../ValidationGroupResolverInterface.php | 0 .../Constraints/PimcoreUniqueEntity.php | 0 .../PimcoreUniqueEntityValidator.php | 10 +- .../areas/members-login/view.html.twig | 0 .../auth/ajax/error.html.twig | 0 .../auth/ajax/success.html.twig | 0 .../auth/area/frontend_request.html.twig | 0 .../auth/area/login_area.html.twig | 0 .../auth/area/login_area_content.html.twig | 0 .../auth/area/login_area_logged_in.html.twig | 0 .../login_area_logged_in_snippet.html.twig | 0 .../views => templates}/auth/login.html.twig | 0 .../auth/login_content.html.twig | 0 .../backend/frontend_request.html.twig | 0 .../change_password.html.twig | 2 +- .../change_password_content.html.twig | 0 .../delete_account}/delete_account.html.twig | 2 +- .../delete_account_content.html.twig | 0 .../views => templates}/email/email.html.twig | 0 .../form/form_wrapper.html.twig | 0 .../views => templates}/layout.html.twig | 0 .../profile/edit.html.twig | 0 .../profile/edit_content.html.twig | 0 .../profile/refused.html.twig | 0 .../profile/show.html.twig | 0 .../profile/show_content.html.twig | 0 .../registration/check_admin.html.twig | 0 .../registration/check_email.html.twig | 0 .../registration/confirmed.html.twig | 0 .../registration/register.html.twig | 0 .../registration/register_content.html.twig | 0 .../resetting/check_email.html.twig | 0 .../resetting/request.html.twig | 0 .../resetting/request_content.html.twig | 0 .../resetting/reset.html.twig | 0 .../resetting/reset_content.html.twig | 0 .../complete_profile.html.twig | 0 .../complete_profile_content.html.twig | 0 .../sso/complete-profile/completed.html.twig | 0 .../sso/partial/_complete_profile.html.twig | 0 .../sso/partial/_social_login.html.twig | 0 ...bled.yml => Acceptance.suite.disabled.yml} | 2 +- .../{acceptance => Acceptance}/_bootstrap.php | 0 ...ite.dist.yml => Functional.suite.dist.yml} | 2 +- .../Frontend/Area/LoginAreaCest.php | 2 +- .../Frontend/Form/ChangePasswordFormCest.php | 2 +- .../Frontend/Form/DeleteAccountFormCest.php | 2 +- .../Frontend/Form/LoginLogoutFormCest.php | 2 +- .../Frontend/Form/ProfileFormCest.php | 2 +- .../Frontend/Form/RegisterFormCest.php | 2 +- .../Frontend/Form/ResettingFormCest.php | 2 +- .../Navigation/RestrictedNavigationCest.php | 2 +- .../Restriction/AssetRestrictionCest.php | 2 +- .../Restriction/DocumentRestrictionCest.php | 2 +- .../Restriction/ObjectRestrictionCest.php | 2 +- .../Validation/GetterCest.php | 2 +- .../Validation/UniqueCest.php | 2 +- .../{functional => Functional}/_bootstrap.php | 0 .../AcceptanceTester.php | 0 .../FunctionalTester.php | 0 .../{_support => Support}/Helper/Members.php | 0 .../Helper/PimcoreBackend.php | 0 .../Helper/PimcoreBundleCore.php | 0 tests/{_support => Support}/RestTester.php | 0 .../TestRestrictedStaticRouteListener.php | 0 .../Test/DachcomBundleTestCase.php | 0 .../{_support => Support}/Test/TestGroup.php | 0 tests/{_support => Support}/Test/TestUser.php | 0 tests/{_support => Support}/UnitTester.php | 0 .../Util/MembersHelper.php | 0 ...nit.suite.dist.yml => Unit.suite.dist.yml} | 2 +- .../Config/ConfigurationTest.php | 0 tests/{unit => Unit}/Dao/GroupTest.php | 2 +- tests/{unit => Unit}/Dao/SsoIdentityTest.php | 2 +- tests/{unit => Unit}/Dao/UserTest.php | 2 +- .../AuthenticationListenerTest.php | 0 .../EventListener/FlashListenerTest.php | 0 .../Manager/ClassManagerTest.php | 0 .../Manager/LoginManagerTest.php | 0 .../Manager/RestrictionManagerTest.php | 0 .../Manager/SsoIdentityManagerTest.php | 0 .../Manager/UserManagerTest.php | 0 .../Security/RoleOptionsProviderTest.php | 0 .../Security/UserCheckerTest.php | 0 .../Security/UserProviderTest.php | 0 tests/{unit => Unit}/_bootstrap.php | 0 tests/_etc/{config.yml => config.yaml} | 0 .../config/app/{config.yml => config.yaml} | 31 ++- tests/_etc/config/app/routes.yaml | 5 + tests/_etc/config/app/routes.yml | 5 - .../app/{security.yml => security.yaml} | 0 .../app/{system.yml => system_settings.yaml} | 6 - ...config_default.yml => config_default.yaml} | 0 ...n.yml => config_reg_confirm_by_admin.yaml} | 0 ...g_confirm_by_admin_with_admin_notify.yaml} | 0 ...onfirm_by_admin_with_after_confirmed.yaml} | 0 ...nt.yml => config_reg_confirm_instant.yaml} | 0 .../admin.de.yml | 0 .../admin.en.yml | 0 .../validators.de.yml | 0 .../validators.en.yml | 0 305 files changed, 435 insertions(+), 896 deletions(-) delete mode 100644 .actrc rename {src/MembersBundle/Resources => config}/install/classes/class_MembersGroup_export.json (100%) rename {src/MembersBundle/Resources => config}/install/classes/class_MembersUser_export.json (100%) rename {src/MembersBundle/Resources => config}/install/classes/class_SsoIdentity_export.json (100%) rename {src/MembersBundle/Resources => config}/install/emails-Members.json (100%) rename {src/MembersBundle/Resources => config}/install/sql/install.sql (100%) rename {src/MembersBundle/Resources => config}/install/translations/admin.csv (100%) rename {src/MembersBundle/Resources => config}/install/translations/frontend.csv (100%) rename src/MembersBundle/Resources/config/oauth.yml => config/oauth.yaml (100%) rename {src/MembersBundle/Resources/config => config}/packages/security_auth_manager.yaml (100%) rename {src/MembersBundle/Resources/config => config}/packages/security_legacy.yaml (100%) rename src/MembersBundle/Resources/config/pimcore/config.yml => config/pimcore/config.yaml (100%) rename src/MembersBundle/Resources/config/pimcore/routing.yml => config/pimcore/routing.yaml (100%) rename src/MembersBundle/Resources/config/pimcore/routing/all.yml => config/pimcore/routing/all.yaml (100%) rename src/MembersBundle/Resources/config/pimcore/routing/auth.yml => config/pimcore/routing/auth.yaml (100%) rename src/MembersBundle/Resources/config/pimcore/routing/change_password.yml => config/pimcore/routing/change_password.yaml (100%) rename src/MembersBundle/Resources/config/pimcore/routing/delete_account.yml => config/pimcore/routing/delete_account.yaml (100%) rename src/MembersBundle/Resources/config/pimcore/routing/oauth.yml => config/pimcore/routing/oauth.yaml (100%) rename src/MembersBundle/Resources/config/pimcore/routing/profile.yml => config/pimcore/routing/profile.yaml (100%) rename src/MembersBundle/Resources/config/pimcore/routing/registration.yml => config/pimcore/routing/registration.yaml (100%) rename src/MembersBundle/Resources/config/pimcore/routing/resetting.yml => config/pimcore/routing/resetting.yaml (100%) rename src/MembersBundle/Resources/config/security_authenticator_manager.yml => config/security.yaml (100%) rename src/MembersBundle/Resources/config/services.yml => config/services.yaml (100%) rename src/MembersBundle/Resources/config/services/_alias.yml => config/services/_alias.yaml (100%) rename src/MembersBundle/Resources/config/services/area.yml => config/services/area.yaml (100%) rename src/MembersBundle/Resources/config/services/change_password.yml => config/services/change_password.yaml (100%) rename src/MembersBundle/Resources/config/services/commands.yml => config/services/commands.yaml (100%) rename src/MembersBundle/Resources/config/services/configuration.yml => config/services/configuration.yaml (100%) rename src/MembersBundle/Resources/config/services/delete_account.yml => config/services/delete_account.yaml (100%) rename src/MembersBundle/Resources/config/services/event.yml => config/services/event.yaml (100%) rename src/MembersBundle/Resources/config/services/mail.yml => config/services/mail.yaml (100%) rename src/MembersBundle/Resources/config/services/manager.yml => config/services/manager.yaml (100%) rename src/MembersBundle/Resources/config/services/oauth/controller.yml => config/services/oauth/controller.yaml (100%) rename src/MembersBundle/Resources/config/services/oauth/event.yml => config/services/oauth/event.yaml (100%) rename src/MembersBundle/Resources/config/services/oauth/form.yml => config/services/oauth/form.yaml (100%) rename src/MembersBundle/Resources/config/services/oauth/mainentance.yml => config/services/oauth/mainentance.yaml (100%) rename src/MembersBundle/Resources/config/services/oauth/manager.yml => config/services/oauth/manager.yaml (100%) rename src/MembersBundle/Resources/config/services/oauth/processor.yml => config/services/oauth/processor.yaml (100%) rename src/MembersBundle/Resources/config/services/oauth/security.yml => config/services/oauth/security.yaml (100%) rename src/MembersBundle/Resources/config/services/oauth/service.yml => config/services/oauth/service.yaml (100%) rename src/MembersBundle/Resources/config/services/oauth/session.yml => config/services/oauth/session.yaml (100%) rename src/MembersBundle/Resources/config/services/oauth/twig.yml => config/services/oauth/twig.yaml (100%) rename src/MembersBundle/Resources/config/services/options_provider.yml => config/services/options_provider.yaml (100%) rename src/MembersBundle/Resources/config/services/profile.yml => config/services/profile.yaml (100%) rename src/MembersBundle/Resources/config/services/registration.yml => config/services/registration.yaml (100%) rename src/MembersBundle/Resources/config/services/registry.yml => config/services/registry.yaml (100%) rename src/MembersBundle/Resources/config/services/resetting.yml => config/services/resetting.yaml (100%) rename src/MembersBundle/Resources/config/services/restriction.yml => config/services/restriction.yaml (100%) rename src/MembersBundle/Resources/config/services/security.yml => config/services/security.yaml (100%) rename src/MembersBundle/Resources/config/services/services.yml => config/services/services.yaml (100%) rename src/MembersBundle/Resources/config/services/session.yml => config/services/session.yaml (100%) rename src/MembersBundle/Resources/config/services/system.yml => config/services/system.yaml (75%) rename src/MembersBundle/Resources/config/services/tool.yml => config/services/tool.yaml (100%) rename src/MembersBundle/Resources/config/services/twig.yml => config/services/twig.yaml (100%) rename src/MembersBundle/Resources/config/services/validator.yml => config/services/validator.yaml (100%) rename src/MembersBundle/Resources/config/validation/User.yml => config/validation/User.yaml (100%) rename {src/MembersBundle/Resources/public => public}/css/admin-editmode.css (100%) rename {src/MembersBundle/Resources/public => public}/css/admin.css (100%) rename {src/MembersBundle/Resources/public => public}/img/group.svg (100%) rename {src/MembersBundle/Resources/public => public}/img/lock.svg (100%) rename {src/MembersBundle/Resources/public => public}/img/members.svg (100%) rename {src/MembersBundle/Resources/public => public}/img/objectGroup.svg (100%) rename {src/MembersBundle/Resources/public => public}/img/objectUser.svg (100%) rename {src/MembersBundle/Resources/public => public}/img/tree_lock.png (100%) rename {src/MembersBundle/Resources/public => public}/img/tree_lock_inherit.png (100%) rename {src/MembersBundle/Resources/public => public}/js/backend/document/restriction.js (100%) rename {src/MembersBundle/Resources/public => public}/js/backend/startup.js (98%) rename {src/MembersBundle/Resources/public => public}/js/pimcore/js/coreExtension/data/dataMultiselect.js (100%) rename {src/MembersBundle/Resources/public => public}/js/pimcore/js/coreExtension/data/membersGroupMultiselect.js (100%) rename {src/MembersBundle/Resources/public => public}/js/pimcore/js/coreExtension/tags/membersGroupMultiselect.js (100%) rename {src/MembersBundle/Resources/public => public}/js/pimcore/js/coreExtension/tags/multiselect.js (100%) rename src/{MembersBundle => }/Adapter/Group/AbstractGroup.php (100%) rename src/{MembersBundle => }/Adapter/Group/GroupInterface.php (100%) rename src/{MembersBundle => }/Adapter/Group/GroupTrait.php (100%) rename src/{MembersBundle => }/Adapter/Sso/AbstractSSoIdentity.php (100%) rename src/{MembersBundle => }/Adapter/Sso/SsoIdentityInterface.php (100%) rename src/{MembersBundle => }/Adapter/User/AbstractCustomerUser.php (100%) rename src/{MembersBundle => }/Adapter/User/AbstractSsoAwareUser.php (100%) rename src/{MembersBundle => }/Adapter/User/AbstractUser.php (100%) rename src/{MembersBundle => }/Adapter/User/SsoAwareUserInterface.php (63%) create mode 100644 src/Adapter/User/UserInterface.php rename src/{MembersBundle => }/Adapter/User/UserTrait.php (100%) rename src/{MembersBundle => }/Command/ClassInstallerCommand.php (100%) rename src/{MembersBundle => }/Command/OAuthSetupCommand.php (100%) create mode 100644 src/Configuration/Configuration.php rename src/{MembersBundle => }/Controller/AbstractController.php (100%) rename src/{MembersBundle => }/Controller/Admin/RestrictionController.php (97%) rename src/{MembersBundle => }/Controller/AuthController.php (97%) rename src/{MembersBundle => }/Controller/ChangePasswordController.php (95%) rename src/{MembersBundle => }/Controller/DeleteAccountController.php (95%) rename src/{MembersBundle => }/Controller/EmailController.php (100%) rename src/{MembersBundle => }/Controller/OAuthController.php (79%) rename src/{MembersBundle => }/Controller/ProfileController.php (97%) rename src/{MembersBundle => }/Controller/RegistrationController.php (83%) rename src/{MembersBundle => }/Controller/RequestController.php (100%) rename src/{MembersBundle => }/Controller/ResettingController.php (97%) rename src/{MembersBundle => }/CoreExtension/GroupMultiselect.php (71%) rename src/{MembersBundle => }/CoreExtension/Provider/RoleOptionsProvider.php (69%) rename src/{MembersBundle => }/DependencyInjection/CompilerPass/OAuthLoginStrategyPass.php (100%) rename src/{MembersBundle => }/DependencyInjection/Configuration.php (100%) rename src/{MembersBundle => }/DependencyInjection/MembersExtension.php (76%) rename src/{MembersBundle => }/Document/Areabrick/MembersLogin/MembersLogin.php (92%) rename src/{MembersBundle => }/Document/Builder/BrickBuilder.php (100%) rename src/{MembersBundle => }/Event/FilterUserResponseEvent.php (100%) rename src/{MembersBundle => }/Event/FormEvent.php (100%) rename src/{MembersBundle => }/Event/GetResponseNullableUserEvent.php (100%) rename src/{MembersBundle => }/Event/GetResponseUserEvent.php (100%) rename src/{MembersBundle => }/Event/OAuth/OAuthIdentityEvent.php (100%) rename src/{MembersBundle => }/Event/OAuth/OAuthResourceEvent.php (100%) rename src/{MembersBundle => }/Event/OAuth/OAuthResponseEvent.php (100%) rename src/{MembersBundle => }/Event/RestrictionEvent.php (100%) rename src/{MembersBundle => }/Event/StaticRouteEvent.php (100%) rename src/{MembersBundle => }/Event/UserEvent.php (100%) create mode 100644 src/EventListener/Admin/AssetListener.php rename src/{MembersBundle => }/EventListener/AssetFrontendPathListener.php (100%) rename src/{MembersBundle => }/EventListener/AuthenticationListener.php (100%) rename src/{MembersBundle => }/EventListener/FlashListener.php (75%) rename src/{MembersBundle => }/EventListener/ForbiddenRouteListener.php (100%) rename src/{MembersBundle => }/EventListener/Frontend/HeadMetaListener.php (100%) rename src/{MembersBundle => }/EventListener/LastLoginListener.php (100%) rename src/{MembersBundle => }/EventListener/Maintenance/SsoCleanUpExpiredTokenListener.php (100%) rename src/{MembersBundle => }/EventListener/MembersCompletenessListener.php (89%) rename src/{MembersBundle => }/EventListener/OAuthRegistrationListener.php (100%) rename src/{MembersBundle => }/EventListener/PostConfirmationListener.php (70%) rename src/{MembersBundle => }/EventListener/ResettingListener.php (100%) rename src/{MembersBundle => }/EventListener/RestrictionStoreListener.php (100%) rename src/{MembersBundle => }/EventListener/TreeListener.php (98%) rename src/{MembersBundle => }/EventListener/UserChangeListener.php (100%) rename src/{MembersBundle => }/Form/Extension/RegistrationAuthIdentifierTypeExtension.php (100%) rename src/{MembersBundle => }/Form/Extension/RegistrationTypeExtension.php (100%) rename src/{MembersBundle => }/Form/Factory/FactoryInterface.php (100%) rename src/{MembersBundle => }/Form/Factory/FormFactory.php (100%) rename src/{MembersBundle => }/Form/Type/ChangePasswordFormType.php (100%) rename src/{MembersBundle => }/Form/Type/DeleteAccountFormType.php (100%) rename src/{MembersBundle => }/Form/Type/LoginFormType.php (100%) rename src/{MembersBundle => }/Form/Type/ProfileFormType.php (100%) rename src/{MembersBundle => }/Form/Type/RegistrationFormType.php (100%) rename src/{MembersBundle => }/Form/Type/ResettingFormType.php (100%) rename src/{MembersBundle => }/Form/Type/ResettingRequestFormType.php (100%) rename src/{MembersBundle => }/Form/Type/Sso/CompleteProfileFormType.php (100%) rename src/{MembersBundle => }/Mailer/Mailer.php (100%) rename src/{MembersBundle => }/Mailer/MailerInterface.php (100%) rename src/{MembersBundle => }/Manager/ClassManager.php (100%) rename src/{MembersBundle => }/Manager/ClassManagerInterface.php (100%) rename src/{MembersBundle => }/Manager/LoginManager.php (100%) rename src/{MembersBundle => }/Manager/LoginManagerInterface.php (100%) rename src/{MembersBundle => }/Manager/RestrictionManager.php (100%) rename src/{MembersBundle => }/Manager/RestrictionManagerInterface.php (100%) rename src/{MembersBundle => }/Manager/SsoIdentityManager.php (100%) rename src/{MembersBundle => }/Manager/SsoIdentityManagerInterface.php (100%) rename src/{MembersBundle => }/Manager/UserManager.php (100%) rename src/{MembersBundle => }/Manager/UserManagerInterface.php (100%) rename src/{MembersBundle => }/MembersBundle.php (61%) delete mode 100644 src/MembersBundle/Adapter/User/UserInterface.php delete mode 100644 src/MembersBundle/Configuration/Configuration.php delete mode 100644 src/MembersBundle/Resources/config/security_legacy.yml delete mode 100644 src/MembersBundle/Security/Encoder/Factory/UserAwareEncoderFactory.php delete mode 100644 src/MembersBundle/Security/OAuthIdentityAuthenticator.php delete mode 100644 src/MembersBundle/Session/SessionConfigurator.php rename src/{MembersBundle => }/MembersEvents.php (100%) rename src/{MembersBundle => }/Migrations/.gitkeep (100%) rename src/{MembersBundle => }/Registry/OAuthLoginProcessorRegistry.php (100%) rename src/{MembersBundle => }/Registry/OAuthLoginProcessorRegistryInterface.php (100%) rename src/{MembersBundle => }/Restriction/Dao.php (73%) rename src/{MembersBundle => }/Restriction/ElementRestriction.php (100%) rename src/{MembersBundle => }/Restriction/Restriction.php (100%) rename src/{MembersBundle => }/Security/Authenticator/OAuthIdentityAuthenticator.php (94%) rename src/{MembersBundle => }/Security/OAuth/AccountConnector.php (100%) rename src/{MembersBundle => }/Security/OAuth/AccountConnectorInterface.php (100%) rename src/{MembersBundle => }/Security/OAuth/Dispatcher/ConnectDispatcher.php (100%) rename src/{MembersBundle => }/Security/OAuth/Dispatcher/DispatcherInterface.php (100%) rename src/{MembersBundle => }/Security/OAuth/Dispatcher/LoginDispatcher.php (100%) rename src/{MembersBundle => }/Security/OAuth/Dispatcher/LoginProcessor/CompleteProfileProcessor.php (86%) rename src/{MembersBundle => }/Security/OAuth/Dispatcher/LoginProcessor/InstantProcessor.php (69%) rename src/{MembersBundle => }/Security/OAuth/Dispatcher/LoginProcessor/LoginProcessorInterface.php (100%) rename src/{MembersBundle => }/Security/OAuth/Dispatcher/Router/DispatchRouter.php (100%) rename src/{MembersBundle => }/Security/OAuth/Exception/AccountNotLinkedException.php (100%) rename src/{MembersBundle => }/Security/OAuth/OAuthRegistrationHandler.php (100%) rename src/{MembersBundle => }/Security/OAuth/OAuthResponse.php (100%) rename src/{MembersBundle => }/Security/OAuth/OAuthResponseInterface.php (100%) rename src/{MembersBundle => }/Security/OAuth/OAuthScopeAllocator.php (100%) rename src/{MembersBundle => }/Security/OAuth/OAuthScopeAllocatorInterface.php (100%) rename src/{MembersBundle => }/Security/OAuth/OAuthTokenStorage.php (65%) rename src/{MembersBundle => }/Security/OAuth/OAuthTokenStorageInterface.php (100%) rename src/{MembersBundle => }/Security/RestrictionQuery.php (98%) rename src/{MembersBundle => }/Security/RestrictionUri.php (100%) rename src/{MembersBundle => }/Security/UserChecker.php (100%) rename src/{MembersBundle => }/Security/UserProvider.php (100%) rename src/{MembersBundle => }/Service/RequestPropertiesForUserExtractorService.php (100%) rename src/{MembersBundle => }/Service/RequestPropertiesForUserExtractorServiceInterface.php (100%) rename src/{MembersBundle => }/Service/ResourceMappingService.php (100%) rename src/{MembersBundle => }/Service/RestrictionService.php (98%) rename src/{MembersBundle => }/Service/SsoIdentityStatusService.php (100%) rename src/{MembersBundle => }/Service/SsoIdentityStatusServiceInterface.php (100%) create mode 100644 src/Session/SessionConfigurator.php rename src/{MembersBundle => }/Tool/ClassInstaller.php (100%) rename src/{MembersBundle => }/Tool/Install.php (96%) rename src/{MembersBundle => }/Tool/TokenGenerator.php (100%) rename src/{MembersBundle => }/Tool/TokenGeneratorInterface.php (100%) rename src/{MembersBundle => }/Twig/Extension/NavigationExtension.php (100%) rename src/{MembersBundle => }/Twig/Extension/OAuthExtension.php (100%) rename src/{MembersBundle => }/Twig/Extension/RestrictionUriExtension.php (100%) rename src/{MembersBundle => }/Twig/Extension/SystemExtension.php (100%) rename src/{MembersBundle => }/Validation/RegistrationValidationGroupResolver.php (63%) rename src/{MembersBundle => }/Validation/ValidationGroupResolverInterface.php (100%) rename src/{MembersBundle => }/Validator/Constraints/PimcoreUniqueEntity.php (100%) rename src/{MembersBundle => }/Validator/Constraints/PimcoreUniqueEntityValidator.php (90%) rename {src/MembersBundle/Resources/views => templates}/areas/members-login/view.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/auth/ajax/error.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/auth/ajax/success.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/auth/area/frontend_request.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/auth/area/login_area.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/auth/area/login_area_content.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/auth/area/login_area_logged_in.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/auth/area/login_area_logged_in_snippet.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/auth/login.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/auth/login_content.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/backend/frontend_request.html.twig (100%) rename {src/MembersBundle/Resources/views/change-password => templates/change_password}/change_password.html.twig (66%) rename {src/MembersBundle/Resources/views/change-password => templates/change_password}/change_password_content.html.twig (100%) rename {src/MembersBundle/Resources/views/delete-account => templates/delete_account}/delete_account.html.twig (66%) rename {src/MembersBundle/Resources/views/delete-account => templates/delete_account}/delete_account_content.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/email/email.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/form/form_wrapper.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/layout.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/profile/edit.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/profile/edit_content.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/profile/refused.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/profile/show.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/profile/show_content.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/registration/check_admin.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/registration/check_email.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/registration/confirmed.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/registration/register.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/registration/register_content.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/resetting/check_email.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/resetting/request.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/resetting/request_content.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/resetting/reset.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/resetting/reset_content.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/sso/complete-profile/complete_profile.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/sso/complete-profile/complete_profile_content.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/sso/complete-profile/completed.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/sso/partial/_complete_profile.html.twig (100%) rename {src/MembersBundle/Resources/views => templates}/sso/partial/_social_login.html.twig (100%) rename tests/{acceptance.suite.disabled.yml => Acceptance.suite.disabled.yml} (93%) rename tests/{acceptance => Acceptance}/_bootstrap.php (100%) rename tests/{functional.suite.dist.yml => Functional.suite.dist.yml} (92%) rename tests/{functional => Functional}/Frontend/Area/LoginAreaCest.php (99%) rename tests/{functional => Functional}/Frontend/Form/ChangePasswordFormCest.php (98%) rename tests/{functional => Functional}/Frontend/Form/DeleteAccountFormCest.php (98%) rename tests/{functional => Functional}/Frontend/Form/LoginLogoutFormCest.php (98%) rename tests/{functional => Functional}/Frontend/Form/ProfileFormCest.php (98%) rename tests/{functional => Functional}/Frontend/Form/RegisterFormCest.php (99%) rename tests/{functional => Functional}/Frontend/Form/ResettingFormCest.php (98%) rename tests/{functional => Functional}/Frontend/Navigation/RestrictedNavigationCest.php (98%) rename tests/{functional => Functional}/Restriction/AssetRestrictionCest.php (99%) rename tests/{functional => Functional}/Restriction/DocumentRestrictionCest.php (98%) rename tests/{functional => Functional}/Restriction/ObjectRestrictionCest.php (99%) rename tests/{functional => Functional}/Validation/GetterCest.php (99%) rename tests/{functional => Functional}/Validation/UniqueCest.php (97%) rename tests/{functional => Functional}/_bootstrap.php (100%) rename tests/{_support => Support}/AcceptanceTester.php (100%) rename tests/{_support => Support}/FunctionalTester.php (100%) rename tests/{_support => Support}/Helper/Members.php (100%) rename tests/{_support => Support}/Helper/PimcoreBackend.php (100%) rename tests/{_support => Support}/Helper/PimcoreBundleCore.php (100%) rename tests/{_support => Support}/RestTester.php (100%) rename tests/{_support => Support}/Services/TestRestrictedStaticRouteListener.php (100%) rename tests/{_support => Support}/Test/DachcomBundleTestCase.php (100%) rename tests/{_support => Support}/Test/TestGroup.php (100%) rename tests/{_support => Support}/Test/TestUser.php (100%) rename tests/{_support => Support}/UnitTester.php (100%) rename tests/{_support => Support}/Util/MembersHelper.php (100%) rename tests/{unit.suite.dist.yml => Unit.suite.dist.yml} (79%) rename tests/{unit => Unit}/Config/ConfigurationTest.php (100%) rename tests/{unit => Unit}/Dao/GroupTest.php (89%) rename tests/{unit => Unit}/Dao/SsoIdentityTest.php (97%) rename tests/{unit => Unit}/Dao/UserTest.php (93%) rename tests/{unit => Unit}/EventListener/AuthenticationListenerTest.php (100%) rename tests/{unit => Unit}/EventListener/FlashListenerTest.php (100%) rename tests/{unit => Unit}/Manager/ClassManagerTest.php (100%) rename tests/{unit => Unit}/Manager/LoginManagerTest.php (100%) rename tests/{unit => Unit}/Manager/RestrictionManagerTest.php (100%) rename tests/{unit => Unit}/Manager/SsoIdentityManagerTest.php (100%) rename tests/{unit => Unit}/Manager/UserManagerTest.php (100%) rename tests/{unit => Unit}/Security/RoleOptionsProviderTest.php (100%) rename tests/{unit => Unit}/Security/UserCheckerTest.php (100%) rename tests/{unit => Unit}/Security/UserProviderTest.php (100%) rename tests/{unit => Unit}/_bootstrap.php (100%) rename tests/_etc/{config.yml => config.yaml} (100%) rename tests/_etc/config/app/{config.yml => config.yaml} (54%) create mode 100644 tests/_etc/config/app/routes.yaml delete mode 100644 tests/_etc/config/app/routes.yml rename tests/_etc/config/app/{security.yml => security.yaml} (100%) rename tests/_etc/config/app/{system.yml => system_settings.yaml} (92%) rename tests/_etc/config/bundle/{config_default.yml => config_default.yaml} (100%) rename tests/_etc/config/bundle/{config_reg_confirm_by_admin.yml => config_reg_confirm_by_admin.yaml} (100%) rename tests/_etc/config/bundle/{config_reg_confirm_by_admin_with_admin_notify.yml => config_reg_confirm_by_admin_with_admin_notify.yaml} (100%) rename tests/_etc/config/bundle/{config_reg_confirm_by_admin_with_after_confirmed.yml => config_reg_confirm_by_admin_with_after_confirmed.yaml} (100%) rename tests/_etc/config/bundle/{config_reg_confirm_instant.yml => config_reg_confirm_instant.yaml} (100%) rename {src/MembersBundle/Resources/translations => translations}/admin.de.yml (100%) rename {src/MembersBundle/Resources/translations => translations}/admin.en.yml (100%) rename {src/MembersBundle/Resources/translations => translations}/validators.de.yml (100%) rename {src/MembersBundle/Resources/translations => translations}/validators.en.yml (100%) diff --git a/.actrc b/.actrc deleted file mode 100644 index 4d0fcdab..00000000 --- a/.actrc +++ /dev/null @@ -1 +0,0 @@ --P ubuntu-latest=gitlab-actions:latest \ No newline at end of file diff --git a/src/MembersBundle/Resources/install/classes/class_MembersGroup_export.json b/config/install/classes/class_MembersGroup_export.json similarity index 100% rename from src/MembersBundle/Resources/install/classes/class_MembersGroup_export.json rename to config/install/classes/class_MembersGroup_export.json diff --git a/src/MembersBundle/Resources/install/classes/class_MembersUser_export.json b/config/install/classes/class_MembersUser_export.json similarity index 100% rename from src/MembersBundle/Resources/install/classes/class_MembersUser_export.json rename to config/install/classes/class_MembersUser_export.json diff --git a/src/MembersBundle/Resources/install/classes/class_SsoIdentity_export.json b/config/install/classes/class_SsoIdentity_export.json similarity index 100% rename from src/MembersBundle/Resources/install/classes/class_SsoIdentity_export.json rename to config/install/classes/class_SsoIdentity_export.json diff --git a/src/MembersBundle/Resources/install/emails-Members.json b/config/install/emails-Members.json similarity index 100% rename from src/MembersBundle/Resources/install/emails-Members.json rename to config/install/emails-Members.json diff --git a/src/MembersBundle/Resources/install/sql/install.sql b/config/install/sql/install.sql similarity index 100% rename from src/MembersBundle/Resources/install/sql/install.sql rename to config/install/sql/install.sql diff --git a/src/MembersBundle/Resources/install/translations/admin.csv b/config/install/translations/admin.csv similarity index 100% rename from src/MembersBundle/Resources/install/translations/admin.csv rename to config/install/translations/admin.csv diff --git a/src/MembersBundle/Resources/install/translations/frontend.csv b/config/install/translations/frontend.csv similarity index 100% rename from src/MembersBundle/Resources/install/translations/frontend.csv rename to config/install/translations/frontend.csv diff --git a/src/MembersBundle/Resources/config/oauth.yml b/config/oauth.yaml similarity index 100% rename from src/MembersBundle/Resources/config/oauth.yml rename to config/oauth.yaml diff --git a/src/MembersBundle/Resources/config/packages/security_auth_manager.yaml b/config/packages/security_auth_manager.yaml similarity index 100% rename from src/MembersBundle/Resources/config/packages/security_auth_manager.yaml rename to config/packages/security_auth_manager.yaml diff --git a/src/MembersBundle/Resources/config/packages/security_legacy.yaml b/config/packages/security_legacy.yaml similarity index 100% rename from src/MembersBundle/Resources/config/packages/security_legacy.yaml rename to config/packages/security_legacy.yaml diff --git a/src/MembersBundle/Resources/config/pimcore/config.yml b/config/pimcore/config.yaml similarity index 100% rename from src/MembersBundle/Resources/config/pimcore/config.yml rename to config/pimcore/config.yaml diff --git a/src/MembersBundle/Resources/config/pimcore/routing.yml b/config/pimcore/routing.yaml similarity index 100% rename from src/MembersBundle/Resources/config/pimcore/routing.yml rename to config/pimcore/routing.yaml diff --git a/src/MembersBundle/Resources/config/pimcore/routing/all.yml b/config/pimcore/routing/all.yaml similarity index 100% rename from src/MembersBundle/Resources/config/pimcore/routing/all.yml rename to config/pimcore/routing/all.yaml diff --git a/src/MembersBundle/Resources/config/pimcore/routing/auth.yml b/config/pimcore/routing/auth.yaml similarity index 100% rename from src/MembersBundle/Resources/config/pimcore/routing/auth.yml rename to config/pimcore/routing/auth.yaml diff --git a/src/MembersBundle/Resources/config/pimcore/routing/change_password.yml b/config/pimcore/routing/change_password.yaml similarity index 100% rename from src/MembersBundle/Resources/config/pimcore/routing/change_password.yml rename to config/pimcore/routing/change_password.yaml diff --git a/src/MembersBundle/Resources/config/pimcore/routing/delete_account.yml b/config/pimcore/routing/delete_account.yaml similarity index 100% rename from src/MembersBundle/Resources/config/pimcore/routing/delete_account.yml rename to config/pimcore/routing/delete_account.yaml diff --git a/src/MembersBundle/Resources/config/pimcore/routing/oauth.yml b/config/pimcore/routing/oauth.yaml similarity index 100% rename from src/MembersBundle/Resources/config/pimcore/routing/oauth.yml rename to config/pimcore/routing/oauth.yaml diff --git a/src/MembersBundle/Resources/config/pimcore/routing/profile.yml b/config/pimcore/routing/profile.yaml similarity index 100% rename from src/MembersBundle/Resources/config/pimcore/routing/profile.yml rename to config/pimcore/routing/profile.yaml diff --git a/src/MembersBundle/Resources/config/pimcore/routing/registration.yml b/config/pimcore/routing/registration.yaml similarity index 100% rename from src/MembersBundle/Resources/config/pimcore/routing/registration.yml rename to config/pimcore/routing/registration.yaml diff --git a/src/MembersBundle/Resources/config/pimcore/routing/resetting.yml b/config/pimcore/routing/resetting.yaml similarity index 100% rename from src/MembersBundle/Resources/config/pimcore/routing/resetting.yml rename to config/pimcore/routing/resetting.yaml diff --git a/src/MembersBundle/Resources/config/security_authenticator_manager.yml b/config/security.yaml similarity index 100% rename from src/MembersBundle/Resources/config/security_authenticator_manager.yml rename to config/security.yaml diff --git a/src/MembersBundle/Resources/config/services.yml b/config/services.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services.yml rename to config/services.yaml diff --git a/src/MembersBundle/Resources/config/services/_alias.yml b/config/services/_alias.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/_alias.yml rename to config/services/_alias.yaml diff --git a/src/MembersBundle/Resources/config/services/area.yml b/config/services/area.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/area.yml rename to config/services/area.yaml diff --git a/src/MembersBundle/Resources/config/services/change_password.yml b/config/services/change_password.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/change_password.yml rename to config/services/change_password.yaml diff --git a/src/MembersBundle/Resources/config/services/commands.yml b/config/services/commands.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/commands.yml rename to config/services/commands.yaml diff --git a/src/MembersBundle/Resources/config/services/configuration.yml b/config/services/configuration.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/configuration.yml rename to config/services/configuration.yaml diff --git a/src/MembersBundle/Resources/config/services/delete_account.yml b/config/services/delete_account.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/delete_account.yml rename to config/services/delete_account.yaml diff --git a/src/MembersBundle/Resources/config/services/event.yml b/config/services/event.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/event.yml rename to config/services/event.yaml diff --git a/src/MembersBundle/Resources/config/services/mail.yml b/config/services/mail.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/mail.yml rename to config/services/mail.yaml diff --git a/src/MembersBundle/Resources/config/services/manager.yml b/config/services/manager.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/manager.yml rename to config/services/manager.yaml diff --git a/src/MembersBundle/Resources/config/services/oauth/controller.yml b/config/services/oauth/controller.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/oauth/controller.yml rename to config/services/oauth/controller.yaml diff --git a/src/MembersBundle/Resources/config/services/oauth/event.yml b/config/services/oauth/event.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/oauth/event.yml rename to config/services/oauth/event.yaml diff --git a/src/MembersBundle/Resources/config/services/oauth/form.yml b/config/services/oauth/form.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/oauth/form.yml rename to config/services/oauth/form.yaml diff --git a/src/MembersBundle/Resources/config/services/oauth/mainentance.yml b/config/services/oauth/mainentance.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/oauth/mainentance.yml rename to config/services/oauth/mainentance.yaml diff --git a/src/MembersBundle/Resources/config/services/oauth/manager.yml b/config/services/oauth/manager.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/oauth/manager.yml rename to config/services/oauth/manager.yaml diff --git a/src/MembersBundle/Resources/config/services/oauth/processor.yml b/config/services/oauth/processor.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/oauth/processor.yml rename to config/services/oauth/processor.yaml diff --git a/src/MembersBundle/Resources/config/services/oauth/security.yml b/config/services/oauth/security.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/oauth/security.yml rename to config/services/oauth/security.yaml diff --git a/src/MembersBundle/Resources/config/services/oauth/service.yml b/config/services/oauth/service.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/oauth/service.yml rename to config/services/oauth/service.yaml diff --git a/src/MembersBundle/Resources/config/services/oauth/session.yml b/config/services/oauth/session.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/oauth/session.yml rename to config/services/oauth/session.yaml diff --git a/src/MembersBundle/Resources/config/services/oauth/twig.yml b/config/services/oauth/twig.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/oauth/twig.yml rename to config/services/oauth/twig.yaml diff --git a/src/MembersBundle/Resources/config/services/options_provider.yml b/config/services/options_provider.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/options_provider.yml rename to config/services/options_provider.yaml diff --git a/src/MembersBundle/Resources/config/services/profile.yml b/config/services/profile.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/profile.yml rename to config/services/profile.yaml diff --git a/src/MembersBundle/Resources/config/services/registration.yml b/config/services/registration.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/registration.yml rename to config/services/registration.yaml diff --git a/src/MembersBundle/Resources/config/services/registry.yml b/config/services/registry.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/registry.yml rename to config/services/registry.yaml diff --git a/src/MembersBundle/Resources/config/services/resetting.yml b/config/services/resetting.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/resetting.yml rename to config/services/resetting.yaml diff --git a/src/MembersBundle/Resources/config/services/restriction.yml b/config/services/restriction.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/restriction.yml rename to config/services/restriction.yaml diff --git a/src/MembersBundle/Resources/config/services/security.yml b/config/services/security.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/security.yml rename to config/services/security.yaml diff --git a/src/MembersBundle/Resources/config/services/services.yml b/config/services/services.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/services.yml rename to config/services/services.yaml diff --git a/src/MembersBundle/Resources/config/services/session.yml b/config/services/session.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/session.yml rename to config/services/session.yaml diff --git a/src/MembersBundle/Resources/config/services/system.yml b/config/services/system.yaml similarity index 75% rename from src/MembersBundle/Resources/config/services/system.yml rename to config/services/system.yaml index a9e8ac77..9c76366e 100644 --- a/src/MembersBundle/Resources/config/services/system.yml +++ b/config/services/system.yaml @@ -9,6 +9,6 @@ services: arguments: $bundle: "@=service('kernel').getBundle('MembersBundle')" calls: - - [setTokenStorageUserResolver, ['@Pimcore\Bundle\AdminBundle\Security\User\TokenStorageUserResolver']] + - [setTokenStorageUserResolver, ['@Pimcore\Security\User\TokenStorageUserResolver']] - [setSerializer, ['@serializer']] - [setConfiguration, ['@MembersBundle\Configuration\Configuration']] \ No newline at end of file diff --git a/src/MembersBundle/Resources/config/services/tool.yml b/config/services/tool.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/tool.yml rename to config/services/tool.yaml diff --git a/src/MembersBundle/Resources/config/services/twig.yml b/config/services/twig.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/twig.yml rename to config/services/twig.yaml diff --git a/src/MembersBundle/Resources/config/services/validator.yml b/config/services/validator.yaml similarity index 100% rename from src/MembersBundle/Resources/config/services/validator.yml rename to config/services/validator.yaml diff --git a/src/MembersBundle/Resources/config/validation/User.yml b/config/validation/User.yaml similarity index 100% rename from src/MembersBundle/Resources/config/validation/User.yml rename to config/validation/User.yaml diff --git a/src/MembersBundle/Resources/public/css/admin-editmode.css b/public/css/admin-editmode.css similarity index 100% rename from src/MembersBundle/Resources/public/css/admin-editmode.css rename to public/css/admin-editmode.css diff --git a/src/MembersBundle/Resources/public/css/admin.css b/public/css/admin.css similarity index 100% rename from src/MembersBundle/Resources/public/css/admin.css rename to public/css/admin.css diff --git a/src/MembersBundle/Resources/public/img/group.svg b/public/img/group.svg similarity index 100% rename from src/MembersBundle/Resources/public/img/group.svg rename to public/img/group.svg diff --git a/src/MembersBundle/Resources/public/img/lock.svg b/public/img/lock.svg similarity index 100% rename from src/MembersBundle/Resources/public/img/lock.svg rename to public/img/lock.svg diff --git a/src/MembersBundle/Resources/public/img/members.svg b/public/img/members.svg similarity index 100% rename from src/MembersBundle/Resources/public/img/members.svg rename to public/img/members.svg diff --git a/src/MembersBundle/Resources/public/img/objectGroup.svg b/public/img/objectGroup.svg similarity index 100% rename from src/MembersBundle/Resources/public/img/objectGroup.svg rename to public/img/objectGroup.svg diff --git a/src/MembersBundle/Resources/public/img/objectUser.svg b/public/img/objectUser.svg similarity index 100% rename from src/MembersBundle/Resources/public/img/objectUser.svg rename to public/img/objectUser.svg diff --git a/src/MembersBundle/Resources/public/img/tree_lock.png b/public/img/tree_lock.png similarity index 100% rename from src/MembersBundle/Resources/public/img/tree_lock.png rename to public/img/tree_lock.png diff --git a/src/MembersBundle/Resources/public/img/tree_lock_inherit.png b/public/img/tree_lock_inherit.png similarity index 100% rename from src/MembersBundle/Resources/public/img/tree_lock_inherit.png rename to public/img/tree_lock_inherit.png diff --git a/src/MembersBundle/Resources/public/js/backend/document/restriction.js b/public/js/backend/document/restriction.js similarity index 100% rename from src/MembersBundle/Resources/public/js/backend/document/restriction.js rename to public/js/backend/document/restriction.js diff --git a/src/MembersBundle/Resources/public/js/backend/startup.js b/public/js/backend/startup.js similarity index 98% rename from src/MembersBundle/Resources/public/js/backend/startup.js rename to public/js/backend/startup.js index fba8e7b6..c2c280a8 100644 --- a/src/MembersBundle/Resources/public/js/backend/startup.js +++ b/public/js/backend/startup.js @@ -114,7 +114,7 @@ class MembersCore { return false; } - if (type === 'object' && this.settings.restriction.allowed_objects.indexOf(obj.data.general.o_className) === -1) { + if (type === 'object' && this.settings.restriction.allowed_objects.indexOf(obj.data.general.className) === -1) { isAllowed = false; } else if (type === 'page' && ['page', 'link'].indexOf(obj.type) === -1) { isAllowed = false; diff --git a/src/MembersBundle/Resources/public/js/pimcore/js/coreExtension/data/dataMultiselect.js b/public/js/pimcore/js/coreExtension/data/dataMultiselect.js similarity index 100% rename from src/MembersBundle/Resources/public/js/pimcore/js/coreExtension/data/dataMultiselect.js rename to public/js/pimcore/js/coreExtension/data/dataMultiselect.js diff --git a/src/MembersBundle/Resources/public/js/pimcore/js/coreExtension/data/membersGroupMultiselect.js b/public/js/pimcore/js/coreExtension/data/membersGroupMultiselect.js similarity index 100% rename from src/MembersBundle/Resources/public/js/pimcore/js/coreExtension/data/membersGroupMultiselect.js rename to public/js/pimcore/js/coreExtension/data/membersGroupMultiselect.js diff --git a/src/MembersBundle/Resources/public/js/pimcore/js/coreExtension/tags/membersGroupMultiselect.js b/public/js/pimcore/js/coreExtension/tags/membersGroupMultiselect.js similarity index 100% rename from src/MembersBundle/Resources/public/js/pimcore/js/coreExtension/tags/membersGroupMultiselect.js rename to public/js/pimcore/js/coreExtension/tags/membersGroupMultiselect.js diff --git a/src/MembersBundle/Resources/public/js/pimcore/js/coreExtension/tags/multiselect.js b/public/js/pimcore/js/coreExtension/tags/multiselect.js similarity index 100% rename from src/MembersBundle/Resources/public/js/pimcore/js/coreExtension/tags/multiselect.js rename to public/js/pimcore/js/coreExtension/tags/multiselect.js diff --git a/src/MembersBundle/Adapter/Group/AbstractGroup.php b/src/Adapter/Group/AbstractGroup.php similarity index 100% rename from src/MembersBundle/Adapter/Group/AbstractGroup.php rename to src/Adapter/Group/AbstractGroup.php diff --git a/src/MembersBundle/Adapter/Group/GroupInterface.php b/src/Adapter/Group/GroupInterface.php similarity index 100% rename from src/MembersBundle/Adapter/Group/GroupInterface.php rename to src/Adapter/Group/GroupInterface.php diff --git a/src/MembersBundle/Adapter/Group/GroupTrait.php b/src/Adapter/Group/GroupTrait.php similarity index 100% rename from src/MembersBundle/Adapter/Group/GroupTrait.php rename to src/Adapter/Group/GroupTrait.php diff --git a/src/MembersBundle/Adapter/Sso/AbstractSSoIdentity.php b/src/Adapter/Sso/AbstractSSoIdentity.php similarity index 100% rename from src/MembersBundle/Adapter/Sso/AbstractSSoIdentity.php rename to src/Adapter/Sso/AbstractSSoIdentity.php diff --git a/src/MembersBundle/Adapter/Sso/SsoIdentityInterface.php b/src/Adapter/Sso/SsoIdentityInterface.php similarity index 100% rename from src/MembersBundle/Adapter/Sso/SsoIdentityInterface.php rename to src/Adapter/Sso/SsoIdentityInterface.php diff --git a/src/MembersBundle/Adapter/User/AbstractCustomerUser.php b/src/Adapter/User/AbstractCustomerUser.php similarity index 100% rename from src/MembersBundle/Adapter/User/AbstractCustomerUser.php rename to src/Adapter/User/AbstractCustomerUser.php diff --git a/src/MembersBundle/Adapter/User/AbstractSsoAwareUser.php b/src/Adapter/User/AbstractSsoAwareUser.php similarity index 100% rename from src/MembersBundle/Adapter/User/AbstractSsoAwareUser.php rename to src/Adapter/User/AbstractSsoAwareUser.php diff --git a/src/MembersBundle/Adapter/User/AbstractUser.php b/src/Adapter/User/AbstractUser.php similarity index 100% rename from src/MembersBundle/Adapter/User/AbstractUser.php rename to src/Adapter/User/AbstractUser.php diff --git a/src/MembersBundle/Adapter/User/SsoAwareUserInterface.php b/src/Adapter/User/SsoAwareUserInterface.php similarity index 63% rename from src/MembersBundle/Adapter/User/SsoAwareUserInterface.php rename to src/Adapter/User/SsoAwareUserInterface.php index cedf50ef..8c4dcea6 100644 --- a/src/MembersBundle/Adapter/User/SsoAwareUserInterface.php +++ b/src/Adapter/User/SsoAwareUserInterface.php @@ -11,10 +11,5 @@ interface SsoAwareUserInterface */ public function getSsoIdentities(): array; - /** - * @param array|null $ssoIdentities - * - * @return $this - */ - public function setSsoIdentities(?array $ssoIdentities); + public function setSsoIdentities(?array $ssoIdentities): static; } diff --git a/src/Adapter/User/UserInterface.php b/src/Adapter/User/UserInterface.php new file mode 100644 index 00000000..3763fea0 --- /dev/null +++ b/src/Adapter/User/UserInterface.php @@ -0,0 +1,81 @@ +config = $config; + } + + public function getConfigArray(): array + { + return $this->config; + } + + public function getConfig(string $slot): mixed + { + return $this->config[$slot]; + } + + public function getOAuthConfig(string $slot): mixed + { + return $this->config['oauth'][$slot]; + } +} diff --git a/src/MembersBundle/Controller/AbstractController.php b/src/Controller/AbstractController.php similarity index 100% rename from src/MembersBundle/Controller/AbstractController.php rename to src/Controller/AbstractController.php diff --git a/src/MembersBundle/Controller/Admin/RestrictionController.php b/src/Controller/Admin/RestrictionController.php similarity index 97% rename from src/MembersBundle/Controller/Admin/RestrictionController.php rename to src/Controller/Admin/RestrictionController.php index 83060bff..85c82003 100644 --- a/src/MembersBundle/Controller/Admin/RestrictionController.php +++ b/src/Controller/Admin/RestrictionController.php @@ -6,14 +6,14 @@ use MembersBundle\Manager\ClassManagerInterface; use MembersBundle\Restriction\Restriction; use MembersBundle\Service\RestrictionService; -use Pimcore\Bundle\AdminBundle\Controller\AdminController; +use Pimcore\Bundle\AdminBundle\Controller\AdminAbstractController; use MembersBundle\Configuration\Configuration; use Pimcore\Model\Element\ElementInterface; use Pimcore\Model\Element\Service; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -class RestrictionController extends AdminController +class RestrictionController extends AdminAbstractController { protected Configuration $configuration; protected ClassManagerInterface $classManager; diff --git a/src/MembersBundle/Controller/AuthController.php b/src/Controller/AuthController.php similarity index 97% rename from src/MembersBundle/Controller/AuthController.php rename to src/Controller/AuthController.php index dab7a0fd..dd7785c5 100644 --- a/src/MembersBundle/Controller/AuthController.php +++ b/src/Controller/AuthController.php @@ -50,7 +50,7 @@ public function loginAction(Request $request): Response $error = null; // The value does not come from the security component. } - return $this->renderForm('@Members/auth/login.html.twig', [ + return $this->render('@Members/auth/login.html.twig', [ 'form' => $form, 'last_username' => $lastUsername, 'error' => $error diff --git a/src/MembersBundle/Controller/ChangePasswordController.php b/src/Controller/ChangePasswordController.php similarity index 95% rename from src/MembersBundle/Controller/ChangePasswordController.php rename to src/Controller/ChangePasswordController.php index 9bfd4d5c..fab4f3ce 100644 --- a/src/MembersBundle/Controller/ChangePasswordController.php +++ b/src/Controller/ChangePasswordController.php @@ -67,8 +67,6 @@ public function changePasswordAction(Request $request): Response return $response; } - return $this->renderForm('@Members/change-password/change_password.html.twig', [ - 'form' => $form, - ]); + return $this->render('@Members/change_password/change_password.html.twig', ['form' => $form]); } } diff --git a/src/MembersBundle/Controller/DeleteAccountController.php b/src/Controller/DeleteAccountController.php similarity index 95% rename from src/MembersBundle/Controller/DeleteAccountController.php rename to src/Controller/DeleteAccountController.php index cba13e04..e66cea6e 100644 --- a/src/MembersBundle/Controller/DeleteAccountController.php +++ b/src/Controller/DeleteAccountController.php @@ -66,8 +66,6 @@ public function deleteAccountAction(Request $request): Response return $response; } - return $this->renderForm('@Members/delete-account/delete_account.html.twig', [ - 'form' => $form, - ]); + return $this->render('@Members/delete_account/delete_account.html.twig', ['form' => $form]); } } diff --git a/src/MembersBundle/Controller/EmailController.php b/src/Controller/EmailController.php similarity index 100% rename from src/MembersBundle/Controller/EmailController.php rename to src/Controller/EmailController.php diff --git a/src/MembersBundle/Controller/OAuthController.php b/src/Controller/OAuthController.php similarity index 79% rename from src/MembersBundle/Controller/OAuthController.php rename to src/Controller/OAuthController.php index 26832e25..30ec8bbe 100644 --- a/src/MembersBundle/Controller/OAuthController.php +++ b/src/Controller/OAuthController.php @@ -13,36 +13,23 @@ use MembersBundle\Service\SsoIdentityStatusServiceInterface; use Pimcore\Http\Request\Resolver\SiteResolver; use Pimcore\Model\Site; +use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag; use Symfony\Component\Security\Core\Exception\AccessDeniedException; class OAuthController extends AbstractController { - protected FactoryInterface $formFactory; - protected EventDispatcherInterface $eventDispatcher; - protected UserManagerInterface $userManager; - protected ClientRegistry $clientRegistry; - protected OAuthScopeAllocatorInterface $scopeAllocator; - protected SsoIdentityStatusServiceInterface $identityStatusService; - public function __construct( - FactoryInterface $formFactory, - EventDispatcherInterface $eventDispatcher, - UserManagerInterface $userManager, - ClientRegistry $clientRegistry, - OAuthScopeAllocatorInterface $scopeAllocator, - SsoIdentityStatusServiceInterface $identityStatusService + protected FactoryInterface $formFactory, + protected EventDispatcherInterface $eventDispatcher, + protected UserManagerInterface $userManager, + protected ClientRegistry $clientRegistry, + protected OAuthScopeAllocatorInterface $scopeAllocator, + protected SsoIdentityStatusServiceInterface $identityStatusService ) { - $this->formFactory = $formFactory; - $this->eventDispatcher = $eventDispatcher; - $this->userManager = $userManager; - $this->clientRegistry = $clientRegistry; - $this->scopeAllocator = $scopeAllocator; - $this->identityStatusService = $identityStatusService; } public function completeProfileAction(Request $request): Response @@ -86,9 +73,7 @@ public function completeProfileAction(Request $request): Response } } - return $this->renderForm('@Members/sso/complete-profile/complete_profile.html.twig', [ - 'form' => $form - ]); + return $this->render('@Members/sso/complete-profile/complete_profile.html.twig', ['form' => $form]); } public function profileCompletedAction(Request $request): Response @@ -132,7 +117,7 @@ protected function oAuthConnect(Request $request, string $provider, array $param ] ]); - /** @var NamespacedAttributeBag $session */ + /** @var AttributeBagInterface $session */ $session = $request->getSession()->getBag('members_session'); $session->set('oauth_state_data', $params); diff --git a/src/MembersBundle/Controller/ProfileController.php b/src/Controller/ProfileController.php similarity index 97% rename from src/MembersBundle/Controller/ProfileController.php rename to src/Controller/ProfileController.php index 8b8596ec..fa920338 100644 --- a/src/MembersBundle/Controller/ProfileController.php +++ b/src/Controller/ProfileController.php @@ -84,9 +84,7 @@ public function editAction(Request $request): Response return $response; } - return $this->renderForm('@Members/profile/edit.html.twig', [ - 'form' => $form, - ]); + return $this->render('@Members/profile/edit.html.twig', ['form' => $form]); } /** diff --git a/src/MembersBundle/Controller/RegistrationController.php b/src/Controller/RegistrationController.php similarity index 83% rename from src/MembersBundle/Controller/RegistrationController.php rename to src/Controller/RegistrationController.php index 3a219525..3580e18b 100644 --- a/src/MembersBundle/Controller/RegistrationController.php +++ b/src/Controller/RegistrationController.php @@ -10,8 +10,8 @@ use MembersBundle\Manager\UserManagerInterface; use MembersBundle\MembersEvents; use MembersBundle\Service\RequestPropertiesForUserExtractorServiceInterface; +use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Exception\AccessDeniedException; @@ -22,24 +22,13 @@ class RegistrationController extends AbstractController { - protected FactoryInterface $formFactory; - protected EventDispatcherInterface $eventDispatcher; - protected UserManagerInterface $userManager; - protected TokenStorageInterface $tokenStorage; - protected RequestPropertiesForUserExtractorServiceInterface $requestPropertiesForUserExtractorService; - public function __construct( - FactoryInterface $formFactory, - EventDispatcherInterface $eventDispatcher, - UserManagerInterface $userManager, - TokenStorageInterface $tokenStorage, - RequestPropertiesForUserExtractorServiceInterface $requestPropertiesForUserExtractorService + protected FactoryInterface $formFactory, + protected EventDispatcherInterface $eventDispatcher, + protected UserManagerInterface $userManager, + protected TokenStorageInterface $tokenStorage, + protected RequestPropertiesForUserExtractorServiceInterface $requestPropertiesForUserExtractorService ) { - $this->formFactory = $formFactory; - $this->eventDispatcher = $eventDispatcher; - $this->userManager = $userManager; - $this->tokenStorage = $tokenStorage; - $this->requestPropertiesForUserExtractorService = $requestPropertiesForUserExtractorService; } public function registerAction(Request $request): Response @@ -84,14 +73,12 @@ public function registerAction(Request $request): Response } } - return $this->renderForm('@Members/registration/register.html.twig', [ - 'form' => $form, - ]); + return $this->render('@Members/registration/register.html.twig', ['form' => $form]); } public function checkEmailAction(Request $request): Response { - /** @var NamespacedAttributeBag $sessionBag */ + /** @var AttributeBagInterface $sessionBag */ $sessionBag = $request->getSession()->getBag('members_session'); $email = $sessionBag->get('members_user_send_confirmation_email/email'); @@ -112,7 +99,7 @@ public function checkEmailAction(Request $request): Response public function checkAdminAction(Request $request): Response { - /** @var NamespacedAttributeBag $sessionBag */ + /** @var AttributeBagInterface $sessionBag */ $sessionBag = $request->getSession()->getBag('members_session'); $email = $sessionBag->get('members_user_send_confirmation_email/email'); @@ -177,7 +164,7 @@ public function confirmedAction(Request $request): Response ]); } - private function getTargetUrlFromSession(NamespacedAttributeBag $session): ?string + private function getTargetUrlFromSession(AttributeBagInterface $session): ?string { $token = $this->tokenStorage->getToken(); diff --git a/src/MembersBundle/Controller/RequestController.php b/src/Controller/RequestController.php similarity index 100% rename from src/MembersBundle/Controller/RequestController.php rename to src/Controller/RequestController.php diff --git a/src/MembersBundle/Controller/ResettingController.php b/src/Controller/ResettingController.php similarity index 97% rename from src/MembersBundle/Controller/ResettingController.php rename to src/Controller/ResettingController.php index 75724d69..04f97243 100644 --- a/src/MembersBundle/Controller/ResettingController.php +++ b/src/Controller/ResettingController.php @@ -52,9 +52,7 @@ public function requestAction(Request $request): Response $form = $this->requestResettingFormFactory->createUnnamedForm(); $form->handleRequest($request); - return $this->renderForm('@Members/resetting/request.html.twig', [ - 'form' => $form, - ]); + return $this->render('@Members/resetting/request.html.twig', ['form' => $form]); } public function sendEmailAction(Request $request): Response @@ -161,7 +159,7 @@ public function resetAction(Request $request, ?string $token = null): Response return $response; } - return $this->renderForm('@Members/resetting/reset.html.twig', [ + return $this->render('@Members/resetting/reset.html.twig', [ 'token' => $token, 'form' => $form, ]); diff --git a/src/MembersBundle/CoreExtension/GroupMultiselect.php b/src/CoreExtension/GroupMultiselect.php similarity index 71% rename from src/MembersBundle/CoreExtension/GroupMultiselect.php rename to src/CoreExtension/GroupMultiselect.php index f1224858..d276c6c9 100644 --- a/src/MembersBundle/CoreExtension/GroupMultiselect.php +++ b/src/CoreExtension/GroupMultiselect.php @@ -5,11 +5,13 @@ use MembersBundle\Adapter\Group\GroupInterface; use Pimcore\Model\DataObject\ClassDefinition\Data\PreGetDataInterface; use Pimcore\Model\DataObject\ClassDefinition\Data\PreSetDataInterface; +use Pimcore\Model\DataObject\Concrete; +use Pimcore\Model\DataObject\Fieldcollection\Data\AbstractData; +use Pimcore\Model\DataObject\Localizedfield; use Pimcore\Model\Element; use Pimcore\Model\DataObject; use Pimcore\Model\DataObject\ClassDefinition\Data\Relations\AbstractRelations; use Pimcore\Model\DataObject\ClassDefinition\Data\QueryResourcePersistenceAwareInterface; -use Pimcore\Model\DataObject\ClassDefinition\Data\Extension; use Pimcore\Normalizer\NormalizerInterface; class GroupMultiselect extends AbstractRelations implements @@ -18,37 +20,10 @@ class GroupMultiselect extends AbstractRelations implements PreSetDataInterface, NormalizerInterface { - use Extension\QueryColumnType; - - /** - * @internal - */ public int $width = 0; - - /** - * @internal - */ public int $height = 0; - - /** - * @internal - */ public string $renderType = 'list'; - - /** - * @var string - */ - public $fieldtype = 'membersGroupMultiselect'; - - /** - * @var string - */ - public $queryColumnType = 'text'; - - /** - * @var bool - */ - public $relationType = true; + public bool $relationType = true; public function setRenderType(string $renderType): self { @@ -86,60 +61,54 @@ public function setHeight(mixed $height): self return $this; } - /** - * {@inheritdoc} - */ + public function getFieldType(): string + { + return 'membersGroupMultiselect'; + } + + public function getQueryColumnType(): array|string + { + return $this->getColumnType(); + } + + public function getColumnType(): string + { + return 'text'; + } + public function getParameterTypeDeclaration(): ?string { return 'array'; } - /** - * {@inheritdoc} - */ public function getReturnTypeDeclaration(): ?string { return '?array'; } - /** - * {@inheritdoc} - */ public function getPhpdocInputType(): ?string { return $this->getPhpdocType(); } - /** - * {@inheritdoc} - */ public function getPhpdocReturnType(): ?string { return $this->getPhpdocType(); } - /** - * {@inheritdoc} - */ - protected function getPhpdocType() + protected function getPhpdocType(): string { return sprintf('array|\%s[]', GroupInterface::class); } - /** - * {@inheritdoc} - */ - public function rewriteIds($container, $idMapping, $params = []) + public function rewriteIds(mixed $container, array $idMapping, array $params = []): mixed { $data = $this->getDataFromObjectParam($container, $params); return $this->rewriteIdsService($data, $idMapping); } - /** - * {@inheritdoc} - */ - public function getDataForEditmode($data, $object = null, $params = []) + public function getDataForEditmode(mixed $data, DataObject\Concrete $object = null, array $params = []): mixed { $returnData = []; @@ -164,10 +133,7 @@ public function getDataForEditmode($data, $object = null, $params = []) return $returnData; } - /** - * {@inheritdoc} - */ - public function getDataFromEditmode($data, $object = null, $params = []) + public function getDataFromEditmode(mixed $data, DataObject\Concrete $object = null, array $params = []): mixed { //if not set, return empty null if ($data === null || $data === false) { @@ -188,10 +154,7 @@ public function getDataFromEditmode($data, $object = null, $params = []) return $elements; } - /** - * {@inheritdoc} - */ - public function getDataForQueryResource($data, $object = null, $params = []) + public function getDataForQueryResource(mixed $data, Concrete $object = null, array $params = []): mixed { //return null when data is not set if (!$data) { @@ -218,71 +181,57 @@ public function getDataForQueryResource($data, $object = null, $params = []) throw new \Exception('invalid data passed to getDataForQueryResource - must be array'); } - /** - * {@inheritdoc} - */ - public function preGetData($object, $params = []) + public function preGetData(mixed $container, array $params = []): mixed { - $data = $object->getObjectVar($this->getName()); - if (!$object->isLazyKeyLoaded($this->getName())) { - $data = $this->load($object, ['force' => true]); + $data = $container->getObjectVar($this->getName()); + if (!$container->isLazyKeyLoaded($this->getName())) { + $data = $this->load($container, ['force' => true]); - $object->setObjectVar($this->getName(), $data); - $this->markLazyloadedFieldAsLoaded($object); + $container->setObjectVar($this->getName(), $data); + $this->markLazyloadedFieldAsLoaded($container); - if ($object instanceof Element\DirtyIndicatorInterface) { - $object->markFieldDirty($this->getName(), false); + if ($container instanceof Element\DirtyIndicatorInterface) { + $container->markFieldDirty($this->getName(), false); } } return is_array($data) ? $data : []; } - /** - * {@inheritDoc} - */ - public function preSetData($object, $data, $params = []) + public function preSetData(mixed $container, mixed $data, array $params = []): mixed { if ($data === null) { $data = []; } - $this->markLazyloadedFieldAsLoaded($object); + $this->markLazyloadedFieldAsLoaded($container); return $data; } - /** - * {@inheritDoc} - */ - public function loadData($data, $object = null, $params = []) + protected function loadData(array $data, Localizedfield|AbstractData|\Pimcore\Model\DataObject\Objectbrick\Data\AbstractData|Concrete $object = null, array $params = []): mixed { $elements = [ 'dirty' => false, 'data' => [] ]; - if (is_array($data)) { - foreach ($data as $element) { - $e = null; - if ($element['type'] === 'object') { - $e = DataObject::getById($element['dest_id']); - } - if ($e instanceof Element\ElementInterface) { - $elements['data'][] = $e; - } else { - $elements['dirty'] = true; - } + foreach ($data as $element) { + $e = null; + if ($element['type'] === 'object') { + $e = DataObject::getById($element['dest_id']); + } + if ($e instanceof Element\ElementInterface) { + $elements['data'][] = $e; + } else { + $elements['dirty'] = true; } } return $elements; } - /** - * {@inheritdoc} - */ - public function prepareDataForPersistence($data, $object = null, $params = []) + protected function prepareDataForPersistence(array|Element\ElementInterface $data, Localizedfield|AbstractData|\Pimcore\Model\DataObject\Objectbrick\Data\AbstractData|Concrete $object = null, array $params = []): mixed { $return = []; @@ -312,10 +261,7 @@ public function prepareDataForPersistence($data, $object = null, $params = []) return null; } - /** - * {@inheritdoc} - */ - public function normalize($value, $params = []) + public function normalize(mixed $value, array $params = []): mixed { if (is_array($value)) { $result = []; @@ -334,10 +280,7 @@ public function normalize($value, $params = []) return null; } - /** - * {@inheritdoc} - */ - public function denormalize($value, $params = []) + public function denormalize(mixed $value, array $params = []): mixed { if (is_array($value)) { $result = []; @@ -356,10 +299,7 @@ public function denormalize($value, $params = []) return null; } - /** - * {@inheritdoc} - */ - public function resolveDependencies($data) + public function resolveDependencies(mixed $data): array { $dependencies = []; @@ -378,10 +318,7 @@ public function resolveDependencies($data) return $dependencies; } - /** - * {@inheritdoc} - */ - public function getVersionPreview($data, $object = null, $params = []) + public function getVersionPreview(mixed $data, DataObject\Concrete $object = null, array $params = []): string { if (is_array($data) && count($data) > 0) { $paths = []; @@ -397,10 +334,7 @@ public function getVersionPreview($data, $object = null, $params = []) return 'no preview'; } - /** - * {@inheritdoc} - */ - public function getForCsvExport($object, $params = []) + public function getForCsvExport(DataObject\Concrete|DataObject\Localizedfield|DataObject\Objectbrick\Data\AbstractData|DataObject\Fieldcollection\Data\AbstractData $object, array $params = []): string { $data = $this->getDataFromObjectParam($object, $params); @@ -411,10 +345,7 @@ public function getForCsvExport($object, $params = []) return ''; } - /** - * {@inheritdoc} - */ - public function getDataForSearchIndex($object, $params = []) + public function getDataForSearchIndex(DataObject\Localizedfield|DataObject\Fieldcollection\Data\AbstractData|DataObject\Objectbrick\Data\AbstractData|DataObject\Concrete $object, array $params = []): string { $data = $this->getDataFromObjectParam($object, $params); diff --git a/src/MembersBundle/CoreExtension/Provider/RoleOptionsProvider.php b/src/CoreExtension/Provider/RoleOptionsProvider.php similarity index 69% rename from src/MembersBundle/CoreExtension/Provider/RoleOptionsProvider.php rename to src/CoreExtension/Provider/RoleOptionsProvider.php index 3fe9b148..3b78ddb2 100644 --- a/src/MembersBundle/CoreExtension/Provider/RoleOptionsProvider.php +++ b/src/CoreExtension/Provider/RoleOptionsProvider.php @@ -17,13 +17,7 @@ public function __construct(array $systemRoles) $this->originalRoles = array_diff_key($systemRoles, array_flip($this->invalidRoles)); } - /** - * @param array $context - * @param Data $fieldDefinition - * - * @return array - */ - public function getOptions($context, $fieldDefinition) + public function getOptions(array $context, Data $fieldDefinition): array { $roles = []; @@ -47,22 +41,12 @@ public function getOptions($context, $fieldDefinition) return $result; } - /** - * @param array $context - * @param Data $fieldDefinition - */ - public function hasStaticOptions($context, $fieldDefinition): bool + public function hasStaticOptions(array $context, Data $fieldDefinition): bool { return false; } - /** - * @param array $context - * @param Data $fieldDefinition - * - * @return string - */ - public function getDefaultValue($context, $fieldDefinition) + public function getDefaultValue(array $context, Data $fieldDefinition): ?string { return 'ROLE_USER'; } diff --git a/src/MembersBundle/DependencyInjection/CompilerPass/OAuthLoginStrategyPass.php b/src/DependencyInjection/CompilerPass/OAuthLoginStrategyPass.php similarity index 100% rename from src/MembersBundle/DependencyInjection/CompilerPass/OAuthLoginStrategyPass.php rename to src/DependencyInjection/CompilerPass/OAuthLoginStrategyPass.php diff --git a/src/MembersBundle/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php similarity index 100% rename from src/MembersBundle/DependencyInjection/Configuration.php rename to src/DependencyInjection/Configuration.php diff --git a/src/MembersBundle/DependencyInjection/MembersExtension.php b/src/DependencyInjection/MembersExtension.php similarity index 76% rename from src/MembersBundle/DependencyInjection/MembersExtension.php rename to src/DependencyInjection/MembersExtension.php index 43dcff07..9aa6b756 100644 --- a/src/MembersBundle/DependencyInjection/MembersExtension.php +++ b/src/DependencyInjection/MembersExtension.php @@ -4,7 +4,6 @@ use MembersBundle\Adapter\User\UserInterface; use MembersBundle\Security\Authenticator\OAuthIdentityAuthenticator; -use MembersBundle\Security\Encoder\Factory\UserAwareEncoderFactory; use MembersBundle\Security\OAuth\Dispatcher\ConnectDispatcher; use MembersBundle\Security\OAuth\Dispatcher\LoginDispatcher; use MembersBundle\Security\OAuth\Dispatcher\Router\DispatchRouter; @@ -30,7 +29,6 @@ public function prepend(ContainerBuilder $container): void } $this->extendPimcoreSecurityConfiguration($container, $oauthEnabled); - } /** @@ -41,8 +39,8 @@ public function load(array $configs, ContainerBuilder $container): void $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); - $loader = new YamlFileLoader($container, new FileLocator([__DIR__ . '/../Resources/config'])); - $loader->load('services.yml'); + $loader = new YamlFileLoader($container, new FileLocator([__DIR__ . '/../../config'])); + $loader->load('services.yaml'); $configManagerDefinition = $container->getDefinition(BundleConfiguration::class); $configManagerDefinition->addMethodCall('setConfig', [$config]); @@ -88,11 +86,11 @@ public function load(array $configs, ContainerBuilder $container): void if ($config['oauth']['enabled']) { $container->setParameter('members.oauth.scopes', $config['oauth']['scopes']); - $loader->load('oauth.yml'); + $loader->load('oauth.yaml'); $this->enableOauth($container, $config); } - $this->buildSecurityConfiguration($container, $loader); + $loader->load('security.yaml'); } protected function enableOauth(ContainerBuilder $container, array $config): void @@ -116,33 +114,6 @@ protected function enableOauth(ContainerBuilder $container, array $config): void protected function extendPimcoreSecurityConfiguration(ContainerBuilder $container, bool $oauthEnabled): void { - if ($this->authenticatorIsEnabled($container) === false) { - - $container->loadFromExtension('pimcore', [ - 'security' => [ - 'encoder_factories' => [ - UserInterface::class => UserAwareEncoderFactory::class - ] - ] - ]); - - if ($oauthEnabled === true) { - $container->loadFromExtension('security', [ - 'firewalls' => [ - 'members_fe' => [ - 'guard' => [ - 'authenticators' => [ - \MembersBundle\Security\OAuthIdentityAuthenticator::class - ] - ] - ] - ] - ]); - } - - return; - } - $container->loadFromExtension('pimcore', [ 'security' => [ 'password_hasher_factories' => [ @@ -163,30 +134,4 @@ protected function extendPimcoreSecurityConfiguration(ContainerBuilder $containe ]); } } - - protected function buildSecurityConfiguration(ContainerBuilder $container, YamlFileLoader $loader): void - { - if ($this->authenticatorIsEnabled($container) === false) { - $loader->load('security_legacy.yml'); - - return; - } - - $loader->load('security_authenticator_manager.yml'); - } - - protected function authenticatorIsEnabled(ContainerBuilder $container): bool - { - /** @phpstan-ignore-next-line */ - if (!$container->hasParameter('security.authenticator.manager.enabled')) { - return false; - } - - /** @phpstan-ignore-next-line */ - if ($container->getParameter('security.authenticator.manager.enabled') !== true) { - return false; - } - - return true; - } } diff --git a/src/MembersBundle/Document/Areabrick/MembersLogin/MembersLogin.php b/src/Document/Areabrick/MembersLogin/MembersLogin.php similarity index 92% rename from src/MembersBundle/Document/Areabrick/MembersLogin/MembersLogin.php rename to src/Document/Areabrick/MembersLogin/MembersLogin.php index 2b5818d3..c230fe61 100644 --- a/src/MembersBundle/Document/Areabrick/MembersLogin/MembersLogin.php +++ b/src/Document/Areabrick/MembersLogin/MembersLogin.php @@ -13,18 +13,11 @@ class MembersLogin extends AbstractAreabrick implements EditableDialogBoxInterface { - protected BrickBuilder $brickBuilder; - protected FactoryInterface $formFactory; - protected Translator $translator; - public function __construct( - BrickBuilder $brickBuilder, - FactoryInterface $formFactory, - Translator $translator + protected BrickBuilder $brickBuilder, + protected FactoryInterface $formFactory, + protected Translator $translator ) { - $this->brickBuilder = $brickBuilder; - $this->formFactory = $formFactory; - $this->translator = $translator; } public function getEditableDialogBoxConfiguration(Document\Editable $area, ?Document\Editable\Area\Info $info): EditableDialogBoxConfiguration diff --git a/src/MembersBundle/Document/Builder/BrickBuilder.php b/src/Document/Builder/BrickBuilder.php similarity index 100% rename from src/MembersBundle/Document/Builder/BrickBuilder.php rename to src/Document/Builder/BrickBuilder.php diff --git a/src/MembersBundle/Event/FilterUserResponseEvent.php b/src/Event/FilterUserResponseEvent.php similarity index 100% rename from src/MembersBundle/Event/FilterUserResponseEvent.php rename to src/Event/FilterUserResponseEvent.php diff --git a/src/MembersBundle/Event/FormEvent.php b/src/Event/FormEvent.php similarity index 100% rename from src/MembersBundle/Event/FormEvent.php rename to src/Event/FormEvent.php diff --git a/src/MembersBundle/Event/GetResponseNullableUserEvent.php b/src/Event/GetResponseNullableUserEvent.php similarity index 100% rename from src/MembersBundle/Event/GetResponseNullableUserEvent.php rename to src/Event/GetResponseNullableUserEvent.php diff --git a/src/MembersBundle/Event/GetResponseUserEvent.php b/src/Event/GetResponseUserEvent.php similarity index 100% rename from src/MembersBundle/Event/GetResponseUserEvent.php rename to src/Event/GetResponseUserEvent.php diff --git a/src/MembersBundle/Event/OAuth/OAuthIdentityEvent.php b/src/Event/OAuth/OAuthIdentityEvent.php similarity index 100% rename from src/MembersBundle/Event/OAuth/OAuthIdentityEvent.php rename to src/Event/OAuth/OAuthIdentityEvent.php diff --git a/src/MembersBundle/Event/OAuth/OAuthResourceEvent.php b/src/Event/OAuth/OAuthResourceEvent.php similarity index 100% rename from src/MembersBundle/Event/OAuth/OAuthResourceEvent.php rename to src/Event/OAuth/OAuthResourceEvent.php diff --git a/src/MembersBundle/Event/OAuth/OAuthResponseEvent.php b/src/Event/OAuth/OAuthResponseEvent.php similarity index 100% rename from src/MembersBundle/Event/OAuth/OAuthResponseEvent.php rename to src/Event/OAuth/OAuthResponseEvent.php diff --git a/src/MembersBundle/Event/RestrictionEvent.php b/src/Event/RestrictionEvent.php similarity index 100% rename from src/MembersBundle/Event/RestrictionEvent.php rename to src/Event/RestrictionEvent.php diff --git a/src/MembersBundle/Event/StaticRouteEvent.php b/src/Event/StaticRouteEvent.php similarity index 100% rename from src/MembersBundle/Event/StaticRouteEvent.php rename to src/Event/StaticRouteEvent.php diff --git a/src/MembersBundle/Event/UserEvent.php b/src/Event/UserEvent.php similarity index 100% rename from src/MembersBundle/Event/UserEvent.php rename to src/Event/UserEvent.php diff --git a/src/EventListener/Admin/AssetListener.php b/src/EventListener/Admin/AssetListener.php new file mode 100644 index 00000000..be8a109e --- /dev/null +++ b/src/EventListener/Admin/AssetListener.php @@ -0,0 +1,45 @@ + 'addCssFiles', + BundleManagerEvents::EDITMODE_CSS_PATHS => 'addEditModeCssFiles', + BundleManagerEvents::JS_PATHS => 'addJsFiles' + ]; + } + + public function addCssFiles(PathsEvent $event): void + { + $event->addPaths([ + '/bundles/members/css/admin.css' + ]); + } + + public function addEditModeCssFiles(PathsEvent $event): void + { + $event->addPaths([ + '/bundles/members/css/admin-editmode.css', + ]); + } + + public function addJsFiles(PathsEvent $event): void + { + $event->addPaths([ + '/bundles/members/js/backend/startup.js', + '/bundles/members/js/backend/document/restriction.js', + '/bundles/members/js/pimcore/js/coreExtension/data/dataMultiselect.js', + '/bundles/members/js/pimcore/js/coreExtension/data/membersGroupMultiselect.js', + '/bundles/members/js/pimcore/js/coreExtension/tags/multiselect.js', + '/bundles/members/js/pimcore/js/coreExtension/tags/membersGroupMultiselect.js' + ]); + } +} diff --git a/src/MembersBundle/EventListener/AssetFrontendPathListener.php b/src/EventListener/AssetFrontendPathListener.php similarity index 100% rename from src/MembersBundle/EventListener/AssetFrontendPathListener.php rename to src/EventListener/AssetFrontendPathListener.php diff --git a/src/MembersBundle/EventListener/AuthenticationListener.php b/src/EventListener/AuthenticationListener.php similarity index 100% rename from src/MembersBundle/EventListener/AuthenticationListener.php rename to src/EventListener/AuthenticationListener.php diff --git a/src/MembersBundle/EventListener/FlashListener.php b/src/EventListener/FlashListener.php similarity index 75% rename from src/MembersBundle/EventListener/FlashListener.php rename to src/EventListener/FlashListener.php index 7752476c..67696a42 100755 --- a/src/MembersBundle/EventListener/FlashListener.php +++ b/src/EventListener/FlashListener.php @@ -3,10 +3,10 @@ namespace MembersBundle\EventListener; use MembersBundle\MembersEvents; +use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Contracts\EventDispatcher\Event; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpFoundation\Session\Session; -use Symfony\Component\HttpFoundation\Session\SessionInterface; use Pimcore\Translation\Translator; class FlashListener implements EventSubscriberInterface @@ -19,13 +19,8 @@ class FlashListener implements EventSubscriberInterface MembersEvents::OAUTH_PROFILE_CONNECTION_SUCCESS => 'members.oauth.connection.success', ]; - protected SessionInterface $session; - protected Translator $translator; - - public function __construct(SessionInterface $session, Translator $translator) + public function __construct(protected RequestStack $requestStack, protected Translator $translator) { - $this->session = $session; - $this->translator = $translator; } public static function getSubscribedEvents(): array @@ -46,15 +41,22 @@ public function addSuccessFlash(Event $event, string $eventName): void throw new \InvalidArgumentException('This event does not correspond to a known flash message.'); } - if (!$this->session instanceof Session) { - throw new \InvalidArgumentException('"%s" needs to be an instance of "%s".', get_class($this->session), Session::class); - } - - $this->session->getFlashBag()->add('success', $this->trans(self::$successMessages[$eventName])); + $this->getSession()->getFlashBag()->add('success', $this->trans(self::$successMessages[$eventName])); } private function trans(string $message, array $params = []): string { return $this->translator->trans($message, $params); } + + private function getSession(): Session + { + $request = $this->requestStack->getCurrentRequest(); + + if ($request === null) { + throw new \LogicException('Cannot get the session without an active request.'); + } + + return $request->getSession(); + } } diff --git a/src/MembersBundle/EventListener/ForbiddenRouteListener.php b/src/EventListener/ForbiddenRouteListener.php similarity index 100% rename from src/MembersBundle/EventListener/ForbiddenRouteListener.php rename to src/EventListener/ForbiddenRouteListener.php diff --git a/src/MembersBundle/EventListener/Frontend/HeadMetaListener.php b/src/EventListener/Frontend/HeadMetaListener.php similarity index 100% rename from src/MembersBundle/EventListener/Frontend/HeadMetaListener.php rename to src/EventListener/Frontend/HeadMetaListener.php diff --git a/src/MembersBundle/EventListener/LastLoginListener.php b/src/EventListener/LastLoginListener.php similarity index 100% rename from src/MembersBundle/EventListener/LastLoginListener.php rename to src/EventListener/LastLoginListener.php diff --git a/src/MembersBundle/EventListener/Maintenance/SsoCleanUpExpiredTokenListener.php b/src/EventListener/Maintenance/SsoCleanUpExpiredTokenListener.php similarity index 100% rename from src/MembersBundle/EventListener/Maintenance/SsoCleanUpExpiredTokenListener.php rename to src/EventListener/Maintenance/SsoCleanUpExpiredTokenListener.php diff --git a/src/MembersBundle/EventListener/MembersCompletenessListener.php b/src/EventListener/MembersCompletenessListener.php similarity index 89% rename from src/MembersBundle/EventListener/MembersCompletenessListener.php rename to src/EventListener/MembersCompletenessListener.php index 0f025213..5f1541aa 100644 --- a/src/MembersBundle/EventListener/MembersCompletenessListener.php +++ b/src/EventListener/MembersCompletenessListener.php @@ -12,23 +12,15 @@ use Pimcore\Model\Element\ValidationException; use Pimcore\Model\User; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Pimcore\Bundle\AdminBundle\Security\User\TokenStorageUserResolver; +use Pimcore\Security\User\TokenStorageUserResolver; class MembersCompletenessListener implements EventSubscriberInterface { - protected int $memberStorageId; - protected ClassManagerInterface $classManager; - protected Configuration $configuration; - protected TokenStorageUserResolver $userResolver; - public function __construct( - ClassManagerInterface $classManager, - Configuration $configuration, - TokenStorageUserResolver $tokenStorageUserResolver + protected ClassManagerInterface $classManager, + protected Configuration $configuration, + protected TokenStorageUserResolver $userResolver ) { - $this->classManager = $classManager; - $this->configuration = $configuration; - $this->userResolver = $tokenStorageUserResolver; } public static function getSubscribedEvents(): array diff --git a/src/MembersBundle/EventListener/OAuthRegistrationListener.php b/src/EventListener/OAuthRegistrationListener.php similarity index 100% rename from src/MembersBundle/EventListener/OAuthRegistrationListener.php rename to src/EventListener/OAuthRegistrationListener.php diff --git a/src/MembersBundle/EventListener/PostConfirmationListener.php b/src/EventListener/PostConfirmationListener.php similarity index 70% rename from src/MembersBundle/EventListener/PostConfirmationListener.php rename to src/EventListener/PostConfirmationListener.php index 7b886dbb..70754e53 100755 --- a/src/MembersBundle/EventListener/PostConfirmationListener.php +++ b/src/EventListener/PostConfirmationListener.php @@ -10,36 +10,21 @@ use MembersBundle\Tool\TokenGenerator; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag; -use Symfony\Component\HttpFoundation\Session\SessionInterface; +use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; class PostConfirmationListener implements EventSubscriberInterface { - protected UserManagerInterface $userManager; - protected MailerInterface $mailer; - protected TokenGenerator $tokenGenerator; - protected UrlGeneratorInterface $router; - protected SessionInterface $session; - protected string $postEventType; - protected string $postEventOauthType; - public function __construct( - UserManagerInterface $userManager, - MailerInterface $mailer, - UrlGeneratorInterface $router, - SessionInterface $session, - TokenGenerator $tokenGenerator, - string $postEventType, - string $postEventOauthType + protected RequestStack $requestStack, + protected UserManagerInterface $userManager, + protected MailerInterface $mailer, + protected UrlGeneratorInterface $router, + protected TokenGenerator $tokenGenerator, + protected string $postEventType, + protected string $postEventOauthType ) { - $this->userManager = $userManager; - $this->mailer = $mailer; - $this->tokenGenerator = $tokenGenerator; - $this->router = $router; - $this->session = $session; - $this->postEventType = $postEventType; - $this->postEventOauthType = $postEventOauthType; } public static function getSubscribedEvents(): array @@ -82,8 +67,7 @@ private function confirmByMail(FormEvent $event): void $this->userManager->updateUser($user); $this->mailer->sendConfirmationEmailMessage($user); - /** @var NamespacedAttributeBag $sessionBag */ - $sessionBag = $this->session->getBag('members_session'); + $sessionBag = $this->getSession()->getBag('members_session'); $sessionBag->set('members_user_send_confirmation_email/email', $user->getEmail()); $url = $this->router->generate('members_user_registration_check_email'); @@ -103,8 +87,7 @@ private function confirmByAdmin(FormEvent $event): void $this->userManager->updateUser($user); $this->mailer->sendAdminNotificationEmailMessage($user); - /** @var NamespacedAttributeBag $sessionBag */ - $sessionBag = $this->session->getBag('members_session'); + $sessionBag = $this->getSession()->getBag('members_session'); $sessionBag->set('members_user_send_confirmation_email/email', $user->getEmail()); $url = $this->router->generate('members_user_registration_check_admin'); @@ -118,4 +101,15 @@ private function confirmInstant(FormEvent $event): void $user->setPublished(true); $this->userManager->updateUser($user); } + + private function getSession(): Session + { + $request = $this->requestStack->getCurrentRequest(); + + if ($request === null) { + throw new \LogicException('Cannot get the session without an active request.'); + } + + return $request->getSession(); + } } diff --git a/src/MembersBundle/EventListener/ResettingListener.php b/src/EventListener/ResettingListener.php similarity index 100% rename from src/MembersBundle/EventListener/ResettingListener.php rename to src/EventListener/ResettingListener.php diff --git a/src/MembersBundle/EventListener/RestrictionStoreListener.php b/src/EventListener/RestrictionStoreListener.php similarity index 100% rename from src/MembersBundle/EventListener/RestrictionStoreListener.php rename to src/EventListener/RestrictionStoreListener.php diff --git a/src/MembersBundle/EventListener/TreeListener.php b/src/EventListener/TreeListener.php similarity index 98% rename from src/MembersBundle/EventListener/TreeListener.php rename to src/EventListener/TreeListener.php index a42c3ea0..9227973e 100644 --- a/src/MembersBundle/EventListener/TreeListener.php +++ b/src/EventListener/TreeListener.php @@ -5,8 +5,7 @@ use MembersBundle\Configuration\Configuration; use MembersBundle\Manager\RestrictionManager; use MembersBundle\Restriction\Restriction; -use MembersBundle\Security\RestrictionUri; -use Pimcore\Event\AdminEvents; +use Pimcore\Bundle\AdminBundle\Event\AdminEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\GenericEvent; diff --git a/src/MembersBundle/EventListener/UserChangeListener.php b/src/EventListener/UserChangeListener.php similarity index 100% rename from src/MembersBundle/EventListener/UserChangeListener.php rename to src/EventListener/UserChangeListener.php diff --git a/src/MembersBundle/Form/Extension/RegistrationAuthIdentifierTypeExtension.php b/src/Form/Extension/RegistrationAuthIdentifierTypeExtension.php similarity index 100% rename from src/MembersBundle/Form/Extension/RegistrationAuthIdentifierTypeExtension.php rename to src/Form/Extension/RegistrationAuthIdentifierTypeExtension.php diff --git a/src/MembersBundle/Form/Extension/RegistrationTypeExtension.php b/src/Form/Extension/RegistrationTypeExtension.php similarity index 100% rename from src/MembersBundle/Form/Extension/RegistrationTypeExtension.php rename to src/Form/Extension/RegistrationTypeExtension.php diff --git a/src/MembersBundle/Form/Factory/FactoryInterface.php b/src/Form/Factory/FactoryInterface.php similarity index 100% rename from src/MembersBundle/Form/Factory/FactoryInterface.php rename to src/Form/Factory/FactoryInterface.php diff --git a/src/MembersBundle/Form/Factory/FormFactory.php b/src/Form/Factory/FormFactory.php similarity index 100% rename from src/MembersBundle/Form/Factory/FormFactory.php rename to src/Form/Factory/FormFactory.php diff --git a/src/MembersBundle/Form/Type/ChangePasswordFormType.php b/src/Form/Type/ChangePasswordFormType.php similarity index 100% rename from src/MembersBundle/Form/Type/ChangePasswordFormType.php rename to src/Form/Type/ChangePasswordFormType.php diff --git a/src/MembersBundle/Form/Type/DeleteAccountFormType.php b/src/Form/Type/DeleteAccountFormType.php similarity index 100% rename from src/MembersBundle/Form/Type/DeleteAccountFormType.php rename to src/Form/Type/DeleteAccountFormType.php diff --git a/src/MembersBundle/Form/Type/LoginFormType.php b/src/Form/Type/LoginFormType.php similarity index 100% rename from src/MembersBundle/Form/Type/LoginFormType.php rename to src/Form/Type/LoginFormType.php diff --git a/src/MembersBundle/Form/Type/ProfileFormType.php b/src/Form/Type/ProfileFormType.php similarity index 100% rename from src/MembersBundle/Form/Type/ProfileFormType.php rename to src/Form/Type/ProfileFormType.php diff --git a/src/MembersBundle/Form/Type/RegistrationFormType.php b/src/Form/Type/RegistrationFormType.php similarity index 100% rename from src/MembersBundle/Form/Type/RegistrationFormType.php rename to src/Form/Type/RegistrationFormType.php diff --git a/src/MembersBundle/Form/Type/ResettingFormType.php b/src/Form/Type/ResettingFormType.php similarity index 100% rename from src/MembersBundle/Form/Type/ResettingFormType.php rename to src/Form/Type/ResettingFormType.php diff --git a/src/MembersBundle/Form/Type/ResettingRequestFormType.php b/src/Form/Type/ResettingRequestFormType.php similarity index 100% rename from src/MembersBundle/Form/Type/ResettingRequestFormType.php rename to src/Form/Type/ResettingRequestFormType.php diff --git a/src/MembersBundle/Form/Type/Sso/CompleteProfileFormType.php b/src/Form/Type/Sso/CompleteProfileFormType.php similarity index 100% rename from src/MembersBundle/Form/Type/Sso/CompleteProfileFormType.php rename to src/Form/Type/Sso/CompleteProfileFormType.php diff --git a/src/MembersBundle/Mailer/Mailer.php b/src/Mailer/Mailer.php similarity index 100% rename from src/MembersBundle/Mailer/Mailer.php rename to src/Mailer/Mailer.php diff --git a/src/MembersBundle/Mailer/MailerInterface.php b/src/Mailer/MailerInterface.php similarity index 100% rename from src/MembersBundle/Mailer/MailerInterface.php rename to src/Mailer/MailerInterface.php diff --git a/src/MembersBundle/Manager/ClassManager.php b/src/Manager/ClassManager.php similarity index 100% rename from src/MembersBundle/Manager/ClassManager.php rename to src/Manager/ClassManager.php diff --git a/src/MembersBundle/Manager/ClassManagerInterface.php b/src/Manager/ClassManagerInterface.php similarity index 100% rename from src/MembersBundle/Manager/ClassManagerInterface.php rename to src/Manager/ClassManagerInterface.php diff --git a/src/MembersBundle/Manager/LoginManager.php b/src/Manager/LoginManager.php similarity index 100% rename from src/MembersBundle/Manager/LoginManager.php rename to src/Manager/LoginManager.php diff --git a/src/MembersBundle/Manager/LoginManagerInterface.php b/src/Manager/LoginManagerInterface.php similarity index 100% rename from src/MembersBundle/Manager/LoginManagerInterface.php rename to src/Manager/LoginManagerInterface.php diff --git a/src/MembersBundle/Manager/RestrictionManager.php b/src/Manager/RestrictionManager.php similarity index 100% rename from src/MembersBundle/Manager/RestrictionManager.php rename to src/Manager/RestrictionManager.php diff --git a/src/MembersBundle/Manager/RestrictionManagerInterface.php b/src/Manager/RestrictionManagerInterface.php similarity index 100% rename from src/MembersBundle/Manager/RestrictionManagerInterface.php rename to src/Manager/RestrictionManagerInterface.php diff --git a/src/MembersBundle/Manager/SsoIdentityManager.php b/src/Manager/SsoIdentityManager.php similarity index 100% rename from src/MembersBundle/Manager/SsoIdentityManager.php rename to src/Manager/SsoIdentityManager.php diff --git a/src/MembersBundle/Manager/SsoIdentityManagerInterface.php b/src/Manager/SsoIdentityManagerInterface.php similarity index 100% rename from src/MembersBundle/Manager/SsoIdentityManagerInterface.php rename to src/Manager/SsoIdentityManagerInterface.php diff --git a/src/MembersBundle/Manager/UserManager.php b/src/Manager/UserManager.php similarity index 100% rename from src/MembersBundle/Manager/UserManager.php rename to src/Manager/UserManager.php diff --git a/src/MembersBundle/Manager/UserManagerInterface.php b/src/Manager/UserManagerInterface.php similarity index 100% rename from src/MembersBundle/Manager/UserManagerInterface.php rename to src/Manager/UserManagerInterface.php diff --git a/src/MembersBundle/MembersBundle.php b/src/MembersBundle.php similarity index 61% rename from src/MembersBundle/MembersBundle.php rename to src/MembersBundle.php index 13397499..06b1da2d 100644 --- a/src/MembersBundle/MembersBundle.php +++ b/src/MembersBundle.php @@ -28,6 +28,11 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new OAuthLoginStrategyPass()); } + public function getPath(): string + { + return \dirname(__DIR__); + } + public static function registerDependentBundles(BundleCollection $collection): void { if (class_exists('\\KnpU\\OAuth2ClientBundle\\KnpUOAuth2ClientBundle')) { @@ -35,32 +40,6 @@ public static function registerDependentBundles(BundleCollection $collection): v } } - public function getJsPaths(): array - { - return [ - '/bundles/members/js/backend/startup.js', - '/bundles/members/js/backend/document/restriction.js', - '/bundles/members/js/pimcore/js/coreExtension/data/dataMultiselect.js', - '/bundles/members/js/pimcore/js/coreExtension/data/membersGroupMultiselect.js', - '/bundles/members/js/pimcore/js/coreExtension/tags/multiselect.js', - '/bundles/members/js/pimcore/js/coreExtension/tags/membersGroupMultiselect.js' - ]; - } - - public function getCssPaths(): array - { - return [ - '/bundles/members/css/admin.css' - ]; - } - - public function getEditmodeCssPaths(): array - { - return [ - '/bundles/members/css/admin-editmode.css', - ]; - } - protected function getComposerPackageName(): string { return self::PACKAGE_NAME; diff --git a/src/MembersBundle/Adapter/User/UserInterface.php b/src/MembersBundle/Adapter/User/UserInterface.php deleted file mode 100644 index 247ba865..00000000 --- a/src/MembersBundle/Adapter/User/UserInterface.php +++ /dev/null @@ -1,163 +0,0 @@ -bundleManager = $bundleManager; - } - - public function setConfig(array $config = []): void - { - $this->config = $config; - } - - public function getConfigArray(): array - { - return $this->config; - } - - public function getConfig(string $slot): mixed - { - return $this->config[$slot]; - } - - public function getOAuthConfig(string $slot): mixed - { - return $this->config['oauth'][$slot]; - } - - public function hasBundle(string $bundleName = 'ExtensionBundle\ExtensionBundle'): bool - { - try { - $hasExtension = $this->bundleManager->isEnabled($bundleName); - } catch (\Exception $e) { - $hasExtension = false; - } - - return $hasExtension; - } -} diff --git a/src/MembersBundle/Resources/config/security_legacy.yml b/src/MembersBundle/Resources/config/security_legacy.yml deleted file mode 100644 index 3bcb2d70..00000000 --- a/src/MembersBundle/Resources/config/security_legacy.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - MembersBundle\Security\Encoder\Factory\UserAwareEncoderFactory: - arguments: - $className: 'Pimcore\Security\Encoder\PasswordFieldEncoder' - $arguments: ['password'] diff --git a/src/MembersBundle/Security/Encoder/Factory/UserAwareEncoderFactory.php b/src/MembersBundle/Security/Encoder/Factory/UserAwareEncoderFactory.php deleted file mode 100644 index cfd53514..00000000 --- a/src/MembersBundle/Security/Encoder/Factory/UserAwareEncoderFactory.php +++ /dev/null @@ -1,12 +0,0 @@ -router = $router; - $this->clientRegistry = $clientRegistry; - $this->ssoIdentityManager = $ssoIdentityManager; - $this->dispatchRouter = $dispatchRouter; - } - - public function supports(Request $request): bool - { - return $request->attributes->get('_route') === 'members_user_security_oauth_check'; - } - - public function getCredentials(Request $request): array - { - /** @var NamespacedAttributeBag $sessionBag */ - $sessionBag = $request->getSession()->getBag('members_session'); - - if (!$sessionBag->has('oauth_state_data')) { - throw new CustomUserMessageAuthenticationException( - 'No oauth_state_data given.' - ); - } - - $data = $sessionBag->get('oauth_state_data'); - $accessToken = $this->fetchAccessToken($this->getClient($data['provider'])); - - return [ - 'access_token' => $accessToken, - 'oauth_state_data' => $data - ]; - } - - /** - * {@inheritDoc} - */ - public function getUser($credentials, UserProviderInterface $userProvider): UserInterface - { - if (!is_array($credentials)) { - throw new CustomUserMessageAuthenticationException( - 'credentials needs to be a array.' - ); - } - - if (!isset($credentials['oauth_state_data'])) { - throw new CustomUserMessageAuthenticationException( - 'No oauth_state_data given.' - ); - } - - if (!isset($credentials['access_token'])) { - throw new CustomUserMessageAuthenticationException( - 'No token given.' - ); - } - - $data = $credentials['oauth_state_data']; - - $provider = $data['provider']; - $type = $data['type']; - $parameter = $data['parameter'] ?? []; - - /** @var AccessToken $accessToken */ - $accessToken = $credentials['access_token']; - - $user = $this->getClient($provider)->fetchUserFromToken($accessToken); - - $oAuthResponse = new OAuthResponse($provider, $accessToken, $user, $parameter); - - $memberUser = $this->ssoIdentityManager->getUserBySsoIdentity($oAuthResponse->getProvider(), $oAuthResponse->getResourceOwner()->getId()); - - if ($memberUser instanceof UserInterface) { - return $memberUser; - } - - return $this->dispatchRouter->dispatch($type, $provider, $oAuthResponse); - } - - public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $providerKey): RedirectResponse - { - /** @var NamespacedAttributeBag $sessionBag */ - $sessionBag = $request->getSession()->getBag('members_session'); - - $data = $sessionBag->get('oauth_state_data'); - - $parameter = $data['parameter'] ?? []; - - $targetUrl = isset($parameter['target_path']) && !empty($parameter['target_path']) ? $parameter['target_path'] : '/'; - - $sessionBag->remove('oauth_state_data'); - - $request->attributes->set('user', $token->getUser()); - - return new RedirectResponse($targetUrl); - } - - public function onAuthenticationFailure(Request $request, AuthenticationException $exception): RedirectResponse - { - $session = $request->getSession(); - - /** @var NamespacedAttributeBag $sessionBag */ - $sessionBag = $session->getBag('members_session'); - - $data = $sessionBag->get('oauth_state_data'); - - $parameter = $data['parameter'] ?? []; - $parameterLocale = $parameter['locale'] ?? null; - - $sessionBag->remove('oauth_state_data'); - $session->set(Security::AUTHENTICATION_ERROR, $exception); - - if ($parameterLocale !== null) { - $request->setLocale($parameterLocale); - } - - $parameter = []; - $routeName = 'members_user_security_login'; - - if ($exception instanceof AccountNotLinkedException) { - $parameter = ['registrationKey' => $exception->getRegistrationKey()]; - $routeName = 'members_user_registration_register'; - } - - return new RedirectResponse($this->router->generate($routeName, $parameter), Response::HTTP_TEMPORARY_REDIRECT); - } - - public function start(Request $request, AuthenticationException $authException = null): RedirectResponse - { - return new RedirectResponse( - $this->router->generate('members_user_security_login'), - Response::HTTP_TEMPORARY_REDIRECT - ); - } - - private function getClient(string $service): OAuth2ClientInterface - { - return $this->clientRegistry->getClient($service); - } -} diff --git a/src/MembersBundle/Session/SessionConfigurator.php b/src/MembersBundle/Session/SessionConfigurator.php deleted file mode 100644 index ef773198..00000000 --- a/src/MembersBundle/Session/SessionConfigurator.php +++ /dev/null @@ -1,20 +0,0 @@ -setName('members_session'); - $session->registerBag($bag); - } -} diff --git a/src/MembersBundle/MembersEvents.php b/src/MembersEvents.php similarity index 100% rename from src/MembersBundle/MembersEvents.php rename to src/MembersEvents.php diff --git a/src/MembersBundle/Migrations/.gitkeep b/src/Migrations/.gitkeep similarity index 100% rename from src/MembersBundle/Migrations/.gitkeep rename to src/Migrations/.gitkeep diff --git a/src/MembersBundle/Registry/OAuthLoginProcessorRegistry.php b/src/Registry/OAuthLoginProcessorRegistry.php similarity index 100% rename from src/MembersBundle/Registry/OAuthLoginProcessorRegistry.php rename to src/Registry/OAuthLoginProcessorRegistry.php diff --git a/src/MembersBundle/Registry/OAuthLoginProcessorRegistryInterface.php b/src/Registry/OAuthLoginProcessorRegistryInterface.php similarity index 100% rename from src/MembersBundle/Registry/OAuthLoginProcessorRegistryInterface.php rename to src/Registry/OAuthLoginProcessorRegistryInterface.php diff --git a/src/MembersBundle/Restriction/Dao.php b/src/Restriction/Dao.php similarity index 73% rename from src/MembersBundle/Restriction/Dao.php rename to src/Restriction/Dao.php index 9eccbc01..5e2dae1f 100644 --- a/src/MembersBundle/Restriction/Dao.php +++ b/src/Restriction/Dao.php @@ -2,19 +2,14 @@ namespace MembersBundle\Restriction; +use Doctrine\DBAL\Exception; use Pimcore\Model; class Dao extends Model\Dao\AbstractDao { - /** - * @var string - */ - protected $tableName = 'members_restrictions'; + protected string $tableName = 'members_restrictions'; - /** - * @var string - */ - protected $tableRelationName = 'members_group_relations'; + protected string $tableRelationName = 'members_group_relations'; /** * @var Restriction @@ -28,14 +23,13 @@ class Dao extends Model\Dao\AbstractDao */ public function getById($id) { - $data = $this->db->fetchRow('SELECT * FROM ' . $this->tableName . ' WHERE id = ?', [$id]); + $data = $this->db->fetchAssociative('SELECT * FROM ' . $this->tableName . ' WHERE id = ?', [$id]); if ($data === false) { throw new \Exception('Object with the ID ' . $id . ' doesn\'t exists'); - } else { - $data = $this->addRelationData($data); } + $data = $this->addRelationData($data); $this->assignVariablesToModel($data); } @@ -48,25 +42,22 @@ public function getById($id) */ public function getByField($field, $value = null, $cType = 'page') { - $data = $this->db->fetchRow('SELECT * FROM ' . $this->tableName . ' WHERE ' . $field . ' = ? AND ctype = ?', [ + $data = $this->db->fetchAssociative('SELECT * FROM ' . $this->tableName . ' WHERE ' . $field . ' = ? AND ctype = ?', [ $value, $cType ]); if ($data === false) { throw new \Exception('Object (Type: ' . $cType . ') with the ' . $field . ' ' . $value . ' doesn\'t exists'); - } else { - $data = $this->addRelationData($data); } + $data = $this->addRelationData($data); $this->assignVariablesToModel($data); } /** * @return bool - * - * @throws \Doctrine\DBAL\DBALException - * @throws \Doctrine\DBAL\Exception\InvalidArgumentException + * @throws Exception */ public function save() { @@ -93,10 +84,11 @@ public function save() * @param array $data * * @return mixed + * @throws Exception */ private function addRelationData($data) { - $relations = $this->db->fetchAll('SELECT * FROM ' . $this->tableRelationName . ' WHERE restrictionId = ?', [$data['id']]); + $relations = $this->db->fetchAllAssociative('SELECT * FROM ' . $this->tableRelationName . ' WHERE restrictionId = ?', [$data['id']]); if ($relations !== false) { foreach ($relations as $relation) { @@ -109,9 +101,7 @@ private function addRelationData($data) /** * @return bool - * - * @throws \Doctrine\DBAL\DBALException - * @throws \Doctrine\DBAL\Exception\InvalidArgumentException + * @throws Exception */ public function saveRelations() { @@ -138,8 +128,7 @@ public function saveRelations() } /** - * @throws \Doctrine\DBAL\DBALException - * @throws \Doctrine\DBAL\Exception\InvalidArgumentException + * @throws Exception */ public function delete() { diff --git a/src/MembersBundle/Restriction/ElementRestriction.php b/src/Restriction/ElementRestriction.php similarity index 100% rename from src/MembersBundle/Restriction/ElementRestriction.php rename to src/Restriction/ElementRestriction.php diff --git a/src/MembersBundle/Restriction/Restriction.php b/src/Restriction/Restriction.php similarity index 100% rename from src/MembersBundle/Restriction/Restriction.php rename to src/Restriction/Restriction.php diff --git a/src/MembersBundle/Security/Authenticator/OAuthIdentityAuthenticator.php b/src/Security/Authenticator/OAuthIdentityAuthenticator.php similarity index 94% rename from src/MembersBundle/Security/Authenticator/OAuthIdentityAuthenticator.php rename to src/Security/Authenticator/OAuthIdentityAuthenticator.php index 9d77710d..cfe9dded 100644 --- a/src/MembersBundle/Security/Authenticator/OAuthIdentityAuthenticator.php +++ b/src/Security/Authenticator/OAuthIdentityAuthenticator.php @@ -13,12 +13,12 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag; +use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException; -use Symfony\Component\Security\Core\Security; +use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; use Symfony\Component\Security\Http\Authenticator\Passport\Passport; use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport; @@ -49,7 +49,7 @@ public function start(Request $request, AuthenticationException $authException = public function authenticate(Request $request): Passport { - /** @var NamespacedAttributeBag $sessionBag */ + /** @var AttributeBagInterface $sessionBag */ $sessionBag = $request->getSession()->getBag('members_session'); if (!$sessionBag->has('oauth_state_data')) { @@ -82,7 +82,7 @@ public function authenticate(Request $request): Passport public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response { - /** @var NamespacedAttributeBag $sessionBag */ + /** @var AttributeBagInterface $sessionBag */ $sessionBag = $request->getSession()->getBag('members_session'); $data = $sessionBag->get('oauth_state_data'); @@ -101,7 +101,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio { $session = $request->getSession(); - /** @var NamespacedAttributeBag $sessionBag */ + /** @var AttributeBagInterface $sessionBag */ $sessionBag = $session->getBag('members_session'); $data = $sessionBag->get('oauth_state_data'); diff --git a/src/MembersBundle/Security/OAuth/AccountConnector.php b/src/Security/OAuth/AccountConnector.php similarity index 100% rename from src/MembersBundle/Security/OAuth/AccountConnector.php rename to src/Security/OAuth/AccountConnector.php diff --git a/src/MembersBundle/Security/OAuth/AccountConnectorInterface.php b/src/Security/OAuth/AccountConnectorInterface.php similarity index 100% rename from src/MembersBundle/Security/OAuth/AccountConnectorInterface.php rename to src/Security/OAuth/AccountConnectorInterface.php diff --git a/src/MembersBundle/Security/OAuth/Dispatcher/ConnectDispatcher.php b/src/Security/OAuth/Dispatcher/ConnectDispatcher.php similarity index 100% rename from src/MembersBundle/Security/OAuth/Dispatcher/ConnectDispatcher.php rename to src/Security/OAuth/Dispatcher/ConnectDispatcher.php diff --git a/src/MembersBundle/Security/OAuth/Dispatcher/DispatcherInterface.php b/src/Security/OAuth/Dispatcher/DispatcherInterface.php similarity index 100% rename from src/MembersBundle/Security/OAuth/Dispatcher/DispatcherInterface.php rename to src/Security/OAuth/Dispatcher/DispatcherInterface.php diff --git a/src/MembersBundle/Security/OAuth/Dispatcher/LoginDispatcher.php b/src/Security/OAuth/Dispatcher/LoginDispatcher.php similarity index 100% rename from src/MembersBundle/Security/OAuth/Dispatcher/LoginDispatcher.php rename to src/Security/OAuth/Dispatcher/LoginDispatcher.php diff --git a/src/MembersBundle/Security/OAuth/Dispatcher/LoginProcessor/CompleteProfileProcessor.php b/src/Security/OAuth/Dispatcher/LoginProcessor/CompleteProfileProcessor.php similarity index 86% rename from src/MembersBundle/Security/OAuth/Dispatcher/LoginProcessor/CompleteProfileProcessor.php rename to src/Security/OAuth/Dispatcher/LoginProcessor/CompleteProfileProcessor.php index f6d746b2..03693dfa 100644 --- a/src/MembersBundle/Security/OAuth/Dispatcher/LoginProcessor/CompleteProfileProcessor.php +++ b/src/Security/OAuth/Dispatcher/LoginProcessor/CompleteProfileProcessor.php @@ -11,11 +11,8 @@ class CompleteProfileProcessor implements LoginProcessorInterface { - protected OAuthTokenStorageInterface $oAuthTokenStorage; - - public function __construct(OAuthTokenStorageInterface $oAuthTokenStorage) + public function __construct(protected OAuthTokenStorageInterface $oAuthTokenStorage) { - $this->oAuthTokenStorage = $oAuthTokenStorage; } public function process(string $provider, OAuthResponse $oAuthResponse): ?UserInterface diff --git a/src/MembersBundle/Security/OAuth/Dispatcher/LoginProcessor/InstantProcessor.php b/src/Security/OAuth/Dispatcher/LoginProcessor/InstantProcessor.php similarity index 69% rename from src/MembersBundle/Security/OAuth/Dispatcher/LoginProcessor/InstantProcessor.php rename to src/Security/OAuth/Dispatcher/LoginProcessor/InstantProcessor.php index 4892ca8c..637c5082 100644 --- a/src/MembersBundle/Security/OAuth/Dispatcher/LoginProcessor/InstantProcessor.php +++ b/src/Security/OAuth/Dispatcher/LoginProcessor/InstantProcessor.php @@ -8,11 +8,8 @@ class InstantProcessor implements LoginProcessorInterface { - protected OAuthRegistrationHandler $oAuthRegistrationHandler; - - public function __construct(OAuthRegistrationHandler $oAuthRegistrationHandler) + public function __construct(protected OAuthRegistrationHandler $oAuthRegistrationHandler) { - $this->oAuthRegistrationHandler = $oAuthRegistrationHandler; } public function process(string $provider, OAuthResponse $oAuthResponse): ?UserInterface diff --git a/src/MembersBundle/Security/OAuth/Dispatcher/LoginProcessor/LoginProcessorInterface.php b/src/Security/OAuth/Dispatcher/LoginProcessor/LoginProcessorInterface.php similarity index 100% rename from src/MembersBundle/Security/OAuth/Dispatcher/LoginProcessor/LoginProcessorInterface.php rename to src/Security/OAuth/Dispatcher/LoginProcessor/LoginProcessorInterface.php diff --git a/src/MembersBundle/Security/OAuth/Dispatcher/Router/DispatchRouter.php b/src/Security/OAuth/Dispatcher/Router/DispatchRouter.php similarity index 100% rename from src/MembersBundle/Security/OAuth/Dispatcher/Router/DispatchRouter.php rename to src/Security/OAuth/Dispatcher/Router/DispatchRouter.php diff --git a/src/MembersBundle/Security/OAuth/Exception/AccountNotLinkedException.php b/src/Security/OAuth/Exception/AccountNotLinkedException.php similarity index 100% rename from src/MembersBundle/Security/OAuth/Exception/AccountNotLinkedException.php rename to src/Security/OAuth/Exception/AccountNotLinkedException.php diff --git a/src/MembersBundle/Security/OAuth/OAuthRegistrationHandler.php b/src/Security/OAuth/OAuthRegistrationHandler.php similarity index 100% rename from src/MembersBundle/Security/OAuth/OAuthRegistrationHandler.php rename to src/Security/OAuth/OAuthRegistrationHandler.php diff --git a/src/MembersBundle/Security/OAuth/OAuthResponse.php b/src/Security/OAuth/OAuthResponse.php similarity index 100% rename from src/MembersBundle/Security/OAuth/OAuthResponse.php rename to src/Security/OAuth/OAuthResponse.php diff --git a/src/MembersBundle/Security/OAuth/OAuthResponseInterface.php b/src/Security/OAuth/OAuthResponseInterface.php similarity index 100% rename from src/MembersBundle/Security/OAuth/OAuthResponseInterface.php rename to src/Security/OAuth/OAuthResponseInterface.php diff --git a/src/MembersBundle/Security/OAuth/OAuthScopeAllocator.php b/src/Security/OAuth/OAuthScopeAllocator.php similarity index 100% rename from src/MembersBundle/Security/OAuth/OAuthScopeAllocator.php rename to src/Security/OAuth/OAuthScopeAllocator.php diff --git a/src/MembersBundle/Security/OAuth/OAuthScopeAllocatorInterface.php b/src/Security/OAuth/OAuthScopeAllocatorInterface.php similarity index 100% rename from src/MembersBundle/Security/OAuth/OAuthScopeAllocatorInterface.php rename to src/Security/OAuth/OAuthScopeAllocatorInterface.php diff --git a/src/MembersBundle/Security/OAuth/OAuthTokenStorage.php b/src/Security/OAuth/OAuthTokenStorage.php similarity index 65% rename from src/MembersBundle/Security/OAuth/OAuthTokenStorage.php rename to src/Security/OAuth/OAuthTokenStorage.php index db9b7783..e42b597e 100644 --- a/src/MembersBundle/Security/OAuth/OAuthTokenStorage.php +++ b/src/Security/OAuth/OAuthTokenStorage.php @@ -2,16 +2,14 @@ namespace MembersBundle\Security\OAuth; -use Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag; -use Symfony\Component\HttpFoundation\Session\SessionInterface; +use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\HttpFoundation\Session\Session; +use Symfony\Component\HttpFoundation\Session\SessionBagInterface; class OAuthTokenStorage implements OAuthTokenStorageInterface { - protected SessionInterface $session; - - public function __construct(SessionInterface $session) + public function __construct(protected RequestStack $requestStack) { - $this->session = $session; } public function saveToken(string $key, OAuthResponseInterface $OAuthResponse): void @@ -43,11 +41,19 @@ protected function buildSessionKey(string $type, string $key): string return sprintf('members.oauth.token.%s.%s', $type, $key); } - protected function getSessionBag(): NamespacedAttributeBag + protected function getSessionBag(): SessionBagInterface + { + return $this->getSession()->getBag('members_session'); + } + + private function getSession(): Session { - /** @var NamespacedAttributeBag $bag */ - $bag = $this->session->getBag('members_session'); + $request = $this->requestStack->getCurrentRequest(); + + if ($request === null) { + throw new \LogicException('Cannot get the session without an active request.'); + } - return $bag; + return $request->getSession(); } } diff --git a/src/MembersBundle/Security/OAuth/OAuthTokenStorageInterface.php b/src/Security/OAuth/OAuthTokenStorageInterface.php similarity index 100% rename from src/MembersBundle/Security/OAuth/OAuthTokenStorageInterface.php rename to src/Security/OAuth/OAuthTokenStorageInterface.php diff --git a/src/MembersBundle/Security/RestrictionQuery.php b/src/Security/RestrictionQuery.php similarity index 98% rename from src/MembersBundle/Security/RestrictionQuery.php rename to src/Security/RestrictionQuery.php index d3d6ec55..7e11a8bb 100644 --- a/src/MembersBundle/Security/RestrictionQuery.php +++ b/src/Security/RestrictionQuery.php @@ -18,7 +18,7 @@ public function __construct(RestrictionManagerInterface $restrictionManager) $this->restrictionManager = $restrictionManager; } - public function addRestrictionInjection(QueryBuilder $query, Model\Listing\AbstractListing $listing, string $queryIdentifier = 'o_id', ?string $aliasFrom = null) + public function addRestrictionInjection(QueryBuilder $query, Model\Listing\AbstractListing $listing, string $queryIdentifier = 'id', ?string $aliasFrom = null) { $additionalQuery = ''; $allowedGroups = []; diff --git a/src/MembersBundle/Security/RestrictionUri.php b/src/Security/RestrictionUri.php similarity index 100% rename from src/MembersBundle/Security/RestrictionUri.php rename to src/Security/RestrictionUri.php diff --git a/src/MembersBundle/Security/UserChecker.php b/src/Security/UserChecker.php similarity index 100% rename from src/MembersBundle/Security/UserChecker.php rename to src/Security/UserChecker.php diff --git a/src/MembersBundle/Security/UserProvider.php b/src/Security/UserProvider.php similarity index 100% rename from src/MembersBundle/Security/UserProvider.php rename to src/Security/UserProvider.php diff --git a/src/MembersBundle/Service/RequestPropertiesForUserExtractorService.php b/src/Service/RequestPropertiesForUserExtractorService.php similarity index 100% rename from src/MembersBundle/Service/RequestPropertiesForUserExtractorService.php rename to src/Service/RequestPropertiesForUserExtractorService.php diff --git a/src/MembersBundle/Service/RequestPropertiesForUserExtractorServiceInterface.php b/src/Service/RequestPropertiesForUserExtractorServiceInterface.php similarity index 100% rename from src/MembersBundle/Service/RequestPropertiesForUserExtractorServiceInterface.php rename to src/Service/RequestPropertiesForUserExtractorServiceInterface.php diff --git a/src/MembersBundle/Service/ResourceMappingService.php b/src/Service/ResourceMappingService.php similarity index 100% rename from src/MembersBundle/Service/ResourceMappingService.php rename to src/Service/ResourceMappingService.php diff --git a/src/MembersBundle/Service/RestrictionService.php b/src/Service/RestrictionService.php similarity index 98% rename from src/MembersBundle/Service/RestrictionService.php rename to src/Service/RestrictionService.php index 61f60dce..6ba9fdb6 100644 --- a/src/MembersBundle/Service/RestrictionService.php +++ b/src/Service/RestrictionService.php @@ -129,8 +129,8 @@ private function updateChildren(ElementInterface $obj, string $cType): void $list = null; if ($obj instanceof Model\DataObject) { $list = new Model\DataObject\Listing(); - $list->setCondition('o_type = ? AND o_path LIKE ?', ['object', $obj->getFullPath() . '/%']); - $list->setOrderKey('LENGTH(o_path) ASC', false); + $list->setCondition('type = ? AND path LIKE ?', ['object', $obj->getFullPath() . '/%']); + $list->setOrderKey('LENGTH(path) ASC', false); } elseif ($obj instanceof Model\Document) { $list = new Model\Document\Listing(); $list->setCondition('type IN ("page", "link") AND path LIKE ?', [$obj->getFullPath() . '/%']); diff --git a/src/MembersBundle/Service/SsoIdentityStatusService.php b/src/Service/SsoIdentityStatusService.php similarity index 100% rename from src/MembersBundle/Service/SsoIdentityStatusService.php rename to src/Service/SsoIdentityStatusService.php diff --git a/src/MembersBundle/Service/SsoIdentityStatusServiceInterface.php b/src/Service/SsoIdentityStatusServiceInterface.php similarity index 100% rename from src/MembersBundle/Service/SsoIdentityStatusServiceInterface.php rename to src/Service/SsoIdentityStatusServiceInterface.php diff --git a/src/Session/SessionConfigurator.php b/src/Session/SessionConfigurator.php new file mode 100644 index 00000000..6cf7ee52 --- /dev/null +++ b/src/Session/SessionConfigurator.php @@ -0,0 +1,40 @@ + ['onKernelRequest', 127] + ]; + } + + public function onKernelRequest(RequestEvent $event): void + { + if (!$event->isMainRequest()) { + return; + } + + if ($event->getRequest()->attributes->get('_stateless', false)) { + return; + } + + $session = $event->getRequest()->getSession(); + + if ($session->isStarted()) { + return; + } + + $bag = new AttributeBag('_members_session'); + $bag->setName('members_session'); + + $session->registerBag($bag); + } +} diff --git a/src/MembersBundle/Tool/ClassInstaller.php b/src/Tool/ClassInstaller.php similarity index 100% rename from src/MembersBundle/Tool/ClassInstaller.php rename to src/Tool/ClassInstaller.php diff --git a/src/MembersBundle/Tool/Install.php b/src/Tool/Install.php similarity index 96% rename from src/MembersBundle/Tool/Install.php rename to src/Tool/Install.php index 0ff2a053..f64e9fdb 100644 --- a/src/MembersBundle/Tool/Install.php +++ b/src/Tool/Install.php @@ -4,8 +4,7 @@ use League\Flysystem\FilesystemException; use MembersBundle\Configuration\Configuration; -use Pimcore\Bundle\AdminBundle\Security\User\TokenStorageUserResolver; -use Pimcore\Db\Connection; +use Pimcore\Security\User\TokenStorageUserResolver; use Pimcore\Extension\Bundle\Installer\Exception\InstallationException; use Pimcore\Extension\Bundle\Installer\SettingsStoreAwareInstaller; use Pimcore\Model\Asset; @@ -205,9 +204,8 @@ public function installTranslations(): void public function installDbStructure(): void { - /** @var Connection $db */ $db = \Pimcore\Db::get(); - $db->query(file_get_contents($this->getInstallSourcesPath() . '/sql/install.sql')); + $db->executeQuery(file_get_contents($this->getInstallSourcesPath() . '/sql/install.sql')); } protected function getUserId(): int @@ -223,6 +221,6 @@ protected function getUserId(): int protected function getInstallSourcesPath(): string { - return __DIR__ . '/../Resources/install'; + return __DIR__ . '/../../config/install'; } } diff --git a/src/MembersBundle/Tool/TokenGenerator.php b/src/Tool/TokenGenerator.php similarity index 100% rename from src/MembersBundle/Tool/TokenGenerator.php rename to src/Tool/TokenGenerator.php diff --git a/src/MembersBundle/Tool/TokenGeneratorInterface.php b/src/Tool/TokenGeneratorInterface.php similarity index 100% rename from src/MembersBundle/Tool/TokenGeneratorInterface.php rename to src/Tool/TokenGeneratorInterface.php diff --git a/src/MembersBundle/Twig/Extension/NavigationExtension.php b/src/Twig/Extension/NavigationExtension.php similarity index 100% rename from src/MembersBundle/Twig/Extension/NavigationExtension.php rename to src/Twig/Extension/NavigationExtension.php diff --git a/src/MembersBundle/Twig/Extension/OAuthExtension.php b/src/Twig/Extension/OAuthExtension.php similarity index 100% rename from src/MembersBundle/Twig/Extension/OAuthExtension.php rename to src/Twig/Extension/OAuthExtension.php diff --git a/src/MembersBundle/Twig/Extension/RestrictionUriExtension.php b/src/Twig/Extension/RestrictionUriExtension.php similarity index 100% rename from src/MembersBundle/Twig/Extension/RestrictionUriExtension.php rename to src/Twig/Extension/RestrictionUriExtension.php diff --git a/src/MembersBundle/Twig/Extension/SystemExtension.php b/src/Twig/Extension/SystemExtension.php similarity index 100% rename from src/MembersBundle/Twig/Extension/SystemExtension.php rename to src/Twig/Extension/SystemExtension.php diff --git a/src/MembersBundle/Validation/RegistrationValidationGroupResolver.php b/src/Validation/RegistrationValidationGroupResolver.php similarity index 63% rename from src/MembersBundle/Validation/RegistrationValidationGroupResolver.php rename to src/Validation/RegistrationValidationGroupResolver.php index d1b76749..bf4e6545 100644 --- a/src/MembersBundle/Validation/RegistrationValidationGroupResolver.php +++ b/src/Validation/RegistrationValidationGroupResolver.php @@ -7,17 +7,12 @@ class RegistrationValidationGroupResolver implements ValidationGroupResolverInterface { - protected ?array $defaultValidationGroups; - protected string $authIdentifier; - protected bool $onlyAuthIdentifierRegistration; - protected RequestStack $requestStack; - - public function __construct(?array $defaultValidationGroups, string $authIdentifier, bool $onlyAuthIdentifierRegistration, RequestStack $requestStack) - { - $this->defaultValidationGroups = $defaultValidationGroups; - $this->authIdentifier = $authIdentifier; - $this->onlyAuthIdentifierRegistration = $onlyAuthIdentifierRegistration; - $this->requestStack = $requestStack; + public function __construct( + protected ?array $defaultValidationGroups, + protected string $authIdentifier, + protected bool $onlyAuthIdentifierRegistration, + protected RequestStack $requestStack + ) { } public function __invoke(FormInterface $form): array @@ -41,5 +36,4 @@ protected function isSSOAwareForm(): bool { return $this->requestStack->getMainRequest()->attributes->get('_members_sso_aware', null) === true; } - -} \ No newline at end of file +} diff --git a/src/MembersBundle/Validation/ValidationGroupResolverInterface.php b/src/Validation/ValidationGroupResolverInterface.php similarity index 100% rename from src/MembersBundle/Validation/ValidationGroupResolverInterface.php rename to src/Validation/ValidationGroupResolverInterface.php diff --git a/src/MembersBundle/Validator/Constraints/PimcoreUniqueEntity.php b/src/Validator/Constraints/PimcoreUniqueEntity.php similarity index 100% rename from src/MembersBundle/Validator/Constraints/PimcoreUniqueEntity.php rename to src/Validator/Constraints/PimcoreUniqueEntity.php diff --git a/src/MembersBundle/Validator/Constraints/PimcoreUniqueEntityValidator.php b/src/Validator/Constraints/PimcoreUniqueEntityValidator.php similarity index 90% rename from src/MembersBundle/Validator/Constraints/PimcoreUniqueEntityValidator.php rename to src/Validator/Constraints/PimcoreUniqueEntityValidator.php index d80615d8..513613d0 100644 --- a/src/MembersBundle/Validator/Constraints/PimcoreUniqueEntityValidator.php +++ b/src/Validator/Constraints/PimcoreUniqueEntityValidator.php @@ -10,16 +10,10 @@ class PimcoreUniqueEntityValidator extends ConstraintValidator { - protected UserManagerInterface $userManager; - - public function __construct(UserManagerInterface $userManager) + public function __construct(protected UserManagerInterface $userManager) { - $this->userManager = $userManager; } - /** - * {@inheritDoc} - */ public function validate($entity, Constraint $constraint): void { if (!$constraint instanceof PimcoreUniqueEntity) { @@ -32,7 +26,7 @@ public function validate($entity, Constraint $constraint): void $fields = $constraint->fields; - if (0 === count($fields)) { + if (count($fields) === 0) { throw new ConstraintDefinitionException('At least one field has to be specified.'); } diff --git a/src/MembersBundle/Resources/views/areas/members-login/view.html.twig b/templates/areas/members-login/view.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/areas/members-login/view.html.twig rename to templates/areas/members-login/view.html.twig diff --git a/src/MembersBundle/Resources/views/auth/ajax/error.html.twig b/templates/auth/ajax/error.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/auth/ajax/error.html.twig rename to templates/auth/ajax/error.html.twig diff --git a/src/MembersBundle/Resources/views/auth/ajax/success.html.twig b/templates/auth/ajax/success.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/auth/ajax/success.html.twig rename to templates/auth/ajax/success.html.twig diff --git a/src/MembersBundle/Resources/views/auth/area/frontend_request.html.twig b/templates/auth/area/frontend_request.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/auth/area/frontend_request.html.twig rename to templates/auth/area/frontend_request.html.twig diff --git a/src/MembersBundle/Resources/views/auth/area/login_area.html.twig b/templates/auth/area/login_area.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/auth/area/login_area.html.twig rename to templates/auth/area/login_area.html.twig diff --git a/src/MembersBundle/Resources/views/auth/area/login_area_content.html.twig b/templates/auth/area/login_area_content.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/auth/area/login_area_content.html.twig rename to templates/auth/area/login_area_content.html.twig diff --git a/src/MembersBundle/Resources/views/auth/area/login_area_logged_in.html.twig b/templates/auth/area/login_area_logged_in.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/auth/area/login_area_logged_in.html.twig rename to templates/auth/area/login_area_logged_in.html.twig diff --git a/src/MembersBundle/Resources/views/auth/area/login_area_logged_in_snippet.html.twig b/templates/auth/area/login_area_logged_in_snippet.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/auth/area/login_area_logged_in_snippet.html.twig rename to templates/auth/area/login_area_logged_in_snippet.html.twig diff --git a/src/MembersBundle/Resources/views/auth/login.html.twig b/templates/auth/login.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/auth/login.html.twig rename to templates/auth/login.html.twig diff --git a/src/MembersBundle/Resources/views/auth/login_content.html.twig b/templates/auth/login_content.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/auth/login_content.html.twig rename to templates/auth/login_content.html.twig diff --git a/src/MembersBundle/Resources/views/backend/frontend_request.html.twig b/templates/backend/frontend_request.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/backend/frontend_request.html.twig rename to templates/backend/frontend_request.html.twig diff --git a/src/MembersBundle/Resources/views/change-password/change_password.html.twig b/templates/change_password/change_password.html.twig similarity index 66% rename from src/MembersBundle/Resources/views/change-password/change_password.html.twig rename to templates/change_password/change_password.html.twig index 0cb22ece..6cf08db1 100755 --- a/src/MembersBundle/Resources/views/change-password/change_password.html.twig +++ b/templates/change_password/change_password.html.twig @@ -1,5 +1,5 @@ {% extends '@Members/layout.html.twig' %} {% block members_user_content %} - {% include '@Members/change-password/change_password_content.html.twig' %} + {% include '@Members/change_password/change_password_content.html.twig' %} {% endblock members_user_content %} diff --git a/src/MembersBundle/Resources/views/change-password/change_password_content.html.twig b/templates/change_password/change_password_content.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/change-password/change_password_content.html.twig rename to templates/change_password/change_password_content.html.twig diff --git a/src/MembersBundle/Resources/views/delete-account/delete_account.html.twig b/templates/delete_account/delete_account.html.twig similarity index 66% rename from src/MembersBundle/Resources/views/delete-account/delete_account.html.twig rename to templates/delete_account/delete_account.html.twig index a5674dcf..70b6162a 100644 --- a/src/MembersBundle/Resources/views/delete-account/delete_account.html.twig +++ b/templates/delete_account/delete_account.html.twig @@ -1,5 +1,5 @@ {% extends '@Members/layout.html.twig' %} {% block members_user_content %} - {% include '@Members/delete-account/delete_account_content.html.twig' %} + {% include '@Members/delete_account/delete_account_content.html.twig' %} {% endblock members_user_content %} diff --git a/src/MembersBundle/Resources/views/delete-account/delete_account_content.html.twig b/templates/delete_account/delete_account_content.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/delete-account/delete_account_content.html.twig rename to templates/delete_account/delete_account_content.html.twig diff --git a/src/MembersBundle/Resources/views/email/email.html.twig b/templates/email/email.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/email/email.html.twig rename to templates/email/email.html.twig diff --git a/src/MembersBundle/Resources/views/form/form_wrapper.html.twig b/templates/form/form_wrapper.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/form/form_wrapper.html.twig rename to templates/form/form_wrapper.html.twig diff --git a/src/MembersBundle/Resources/views/layout.html.twig b/templates/layout.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/layout.html.twig rename to templates/layout.html.twig diff --git a/src/MembersBundle/Resources/views/profile/edit.html.twig b/templates/profile/edit.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/profile/edit.html.twig rename to templates/profile/edit.html.twig diff --git a/src/MembersBundle/Resources/views/profile/edit_content.html.twig b/templates/profile/edit_content.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/profile/edit_content.html.twig rename to templates/profile/edit_content.html.twig diff --git a/src/MembersBundle/Resources/views/profile/refused.html.twig b/templates/profile/refused.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/profile/refused.html.twig rename to templates/profile/refused.html.twig diff --git a/src/MembersBundle/Resources/views/profile/show.html.twig b/templates/profile/show.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/profile/show.html.twig rename to templates/profile/show.html.twig diff --git a/src/MembersBundle/Resources/views/profile/show_content.html.twig b/templates/profile/show_content.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/profile/show_content.html.twig rename to templates/profile/show_content.html.twig diff --git a/src/MembersBundle/Resources/views/registration/check_admin.html.twig b/templates/registration/check_admin.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/registration/check_admin.html.twig rename to templates/registration/check_admin.html.twig diff --git a/src/MembersBundle/Resources/views/registration/check_email.html.twig b/templates/registration/check_email.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/registration/check_email.html.twig rename to templates/registration/check_email.html.twig diff --git a/src/MembersBundle/Resources/views/registration/confirmed.html.twig b/templates/registration/confirmed.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/registration/confirmed.html.twig rename to templates/registration/confirmed.html.twig diff --git a/src/MembersBundle/Resources/views/registration/register.html.twig b/templates/registration/register.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/registration/register.html.twig rename to templates/registration/register.html.twig diff --git a/src/MembersBundle/Resources/views/registration/register_content.html.twig b/templates/registration/register_content.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/registration/register_content.html.twig rename to templates/registration/register_content.html.twig diff --git a/src/MembersBundle/Resources/views/resetting/check_email.html.twig b/templates/resetting/check_email.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/resetting/check_email.html.twig rename to templates/resetting/check_email.html.twig diff --git a/src/MembersBundle/Resources/views/resetting/request.html.twig b/templates/resetting/request.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/resetting/request.html.twig rename to templates/resetting/request.html.twig diff --git a/src/MembersBundle/Resources/views/resetting/request_content.html.twig b/templates/resetting/request_content.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/resetting/request_content.html.twig rename to templates/resetting/request_content.html.twig diff --git a/src/MembersBundle/Resources/views/resetting/reset.html.twig b/templates/resetting/reset.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/resetting/reset.html.twig rename to templates/resetting/reset.html.twig diff --git a/src/MembersBundle/Resources/views/resetting/reset_content.html.twig b/templates/resetting/reset_content.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/resetting/reset_content.html.twig rename to templates/resetting/reset_content.html.twig diff --git a/src/MembersBundle/Resources/views/sso/complete-profile/complete_profile.html.twig b/templates/sso/complete-profile/complete_profile.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/sso/complete-profile/complete_profile.html.twig rename to templates/sso/complete-profile/complete_profile.html.twig diff --git a/src/MembersBundle/Resources/views/sso/complete-profile/complete_profile_content.html.twig b/templates/sso/complete-profile/complete_profile_content.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/sso/complete-profile/complete_profile_content.html.twig rename to templates/sso/complete-profile/complete_profile_content.html.twig diff --git a/src/MembersBundle/Resources/views/sso/complete-profile/completed.html.twig b/templates/sso/complete-profile/completed.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/sso/complete-profile/completed.html.twig rename to templates/sso/complete-profile/completed.html.twig diff --git a/src/MembersBundle/Resources/views/sso/partial/_complete_profile.html.twig b/templates/sso/partial/_complete_profile.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/sso/partial/_complete_profile.html.twig rename to templates/sso/partial/_complete_profile.html.twig diff --git a/src/MembersBundle/Resources/views/sso/partial/_social_login.html.twig b/templates/sso/partial/_social_login.html.twig similarity index 100% rename from src/MembersBundle/Resources/views/sso/partial/_social_login.html.twig rename to templates/sso/partial/_social_login.html.twig diff --git a/tests/acceptance.suite.disabled.yml b/tests/Acceptance.suite.disabled.yml similarity index 93% rename from tests/acceptance.suite.disabled.yml rename to tests/Acceptance.suite.disabled.yml index d007693d..b80488e3 100644 --- a/tests/acceptance.suite.disabled.yml +++ b/tests/Acceptance.suite.disabled.yml @@ -1,5 +1,5 @@ actor: AcceptanceTester -error_level: 'getenv("PIMCORE_PHP_ERROR_REPORTING")' +error_level: '%PIMCORE_PHP_ERROR_REPORTING%' modules: config: \Dachcom\Codeception\Helper\Browser\WebDriver: diff --git a/tests/acceptance/_bootstrap.php b/tests/Acceptance/_bootstrap.php similarity index 100% rename from tests/acceptance/_bootstrap.php rename to tests/Acceptance/_bootstrap.php diff --git a/tests/functional.suite.dist.yml b/tests/Functional.suite.dist.yml similarity index 92% rename from tests/functional.suite.dist.yml rename to tests/Functional.suite.dist.yml index 80b9a61b..84ef4712 100644 --- a/tests/functional.suite.dist.yml +++ b/tests/Functional.suite.dist.yml @@ -1,5 +1,5 @@ actor: FunctionalTester -error_level: 'getenv("PIMCORE_PHP_ERROR_REPORTING")' +error_level: '%PIMCORE_PHP_ERROR_REPORTING%' modules: enabled: - \Pimcore\Tests\Helper\ClassManager diff --git a/tests/functional/Frontend/Area/LoginAreaCest.php b/tests/Functional/Frontend/Area/LoginAreaCest.php similarity index 99% rename from tests/functional/Frontend/Area/LoginAreaCest.php rename to tests/Functional/Frontend/Area/LoginAreaCest.php index 5f80a9fa..7784d8ab 100644 --- a/tests/functional/Frontend/Area/LoginAreaCest.php +++ b/tests/Functional/Frontend/Area/LoginAreaCest.php @@ -3,7 +3,7 @@ namespace DachcomBundle\Test\functional\Frontend\Area; use Codeception\Exception\ModuleException; -use DachcomBundle\Test\FunctionalTester; +use DachcomBundle\Test\Support\FunctionalTester; use DachcomBundle\Test\Util\MembersHelper; class LoginAreaCest diff --git a/tests/functional/Frontend/Form/ChangePasswordFormCest.php b/tests/Functional/Frontend/Form/ChangePasswordFormCest.php similarity index 98% rename from tests/functional/Frontend/Form/ChangePasswordFormCest.php rename to tests/Functional/Frontend/Form/ChangePasswordFormCest.php index bb757963..bb5b6ad3 100644 --- a/tests/functional/Frontend/Form/ChangePasswordFormCest.php +++ b/tests/Functional/Frontend/Form/ChangePasswordFormCest.php @@ -2,7 +2,7 @@ namespace DachcomBundle\Test\functional\Frontend\Form; -use DachcomBundle\Test\FunctionalTester; +use DachcomBundle\Test\Support\FunctionalTester; use DachcomBundle\Test\Util\MembersHelper; class ChangePasswordFormCest diff --git a/tests/functional/Frontend/Form/DeleteAccountFormCest.php b/tests/Functional/Frontend/Form/DeleteAccountFormCest.php similarity index 98% rename from tests/functional/Frontend/Form/DeleteAccountFormCest.php rename to tests/Functional/Frontend/Form/DeleteAccountFormCest.php index 633be9f7..cf4d1c36 100644 --- a/tests/functional/Frontend/Form/DeleteAccountFormCest.php +++ b/tests/Functional/Frontend/Form/DeleteAccountFormCest.php @@ -2,7 +2,7 @@ namespace DachcomBundle\Test\functional\Frontend\Form; -use DachcomBundle\Test\FunctionalTester; +use DachcomBundle\Test\Support\FunctionalTester; use DachcomBundle\Test\Util\MembersHelper; class DeleteAccountFormCest diff --git a/tests/functional/Frontend/Form/LoginLogoutFormCest.php b/tests/Functional/Frontend/Form/LoginLogoutFormCest.php similarity index 98% rename from tests/functional/Frontend/Form/LoginLogoutFormCest.php rename to tests/Functional/Frontend/Form/LoginLogoutFormCest.php index b6300536..2c4bf19e 100644 --- a/tests/functional/Frontend/Form/LoginLogoutFormCest.php +++ b/tests/Functional/Frontend/Form/LoginLogoutFormCest.php @@ -2,7 +2,7 @@ namespace DachcomBundle\Test\functional\Frontend\Form; -use DachcomBundle\Test\FunctionalTester; +use DachcomBundle\Test\Support\FunctionalTester; use DachcomBundle\Test\Util\MembersHelper; class LoginLogoutFormCest diff --git a/tests/functional/Frontend/Form/ProfileFormCest.php b/tests/Functional/Frontend/Form/ProfileFormCest.php similarity index 98% rename from tests/functional/Frontend/Form/ProfileFormCest.php rename to tests/Functional/Frontend/Form/ProfileFormCest.php index c37dc776..3f4bb320 100644 --- a/tests/functional/Frontend/Form/ProfileFormCest.php +++ b/tests/Functional/Frontend/Form/ProfileFormCest.php @@ -2,7 +2,7 @@ namespace DachcomBundle\Test\functional\Frontend\Form; -use DachcomBundle\Test\FunctionalTester; +use DachcomBundle\Test\Support\FunctionalTester; use DachcomBundle\Test\Util\MembersHelper; class ProfileFormCest diff --git a/tests/functional/Frontend/Form/RegisterFormCest.php b/tests/Functional/Frontend/Form/RegisterFormCest.php similarity index 99% rename from tests/functional/Frontend/Form/RegisterFormCest.php rename to tests/Functional/Frontend/Form/RegisterFormCest.php index 05f6c70b..48c0e3bf 100644 --- a/tests/functional/Frontend/Form/RegisterFormCest.php +++ b/tests/Functional/Frontend/Form/RegisterFormCest.php @@ -2,7 +2,7 @@ namespace DachcomBundle\Test\functional\Frontend\Form; -use DachcomBundle\Test\FunctionalTester; +use DachcomBundle\Test\Support\FunctionalTester; use DachcomBundle\Test\Util\MembersHelper; use Pimcore\Model\Document\Email; diff --git a/tests/functional/Frontend/Form/ResettingFormCest.php b/tests/Functional/Frontend/Form/ResettingFormCest.php similarity index 98% rename from tests/functional/Frontend/Form/ResettingFormCest.php rename to tests/Functional/Frontend/Form/ResettingFormCest.php index 879dd8e6..5e43f256 100644 --- a/tests/functional/Frontend/Form/ResettingFormCest.php +++ b/tests/Functional/Frontend/Form/ResettingFormCest.php @@ -2,7 +2,7 @@ namespace DachcomBundle\Test\functional\Frontend\Form; -use DachcomBundle\Test\FunctionalTester; +use DachcomBundle\Test\Support\FunctionalTester; use DachcomBundle\Test\Util\MembersHelper; use Pimcore\Model\Document\Email; diff --git a/tests/functional/Frontend/Navigation/RestrictedNavigationCest.php b/tests/Functional/Frontend/Navigation/RestrictedNavigationCest.php similarity index 98% rename from tests/functional/Frontend/Navigation/RestrictedNavigationCest.php rename to tests/Functional/Frontend/Navigation/RestrictedNavigationCest.php index 18c4137b..0c4f28b7 100644 --- a/tests/functional/Frontend/Navigation/RestrictedNavigationCest.php +++ b/tests/Functional/Frontend/Navigation/RestrictedNavigationCest.php @@ -2,7 +2,7 @@ namespace DachcomBundle\Test\functional\Frontend\Navigation; -use DachcomBundle\Test\FunctionalTester; +use DachcomBundle\Test\Support\FunctionalTester; class RestrictedNavigationCest { diff --git a/tests/functional/Restriction/AssetRestrictionCest.php b/tests/Functional/Restriction/AssetRestrictionCest.php similarity index 99% rename from tests/functional/Restriction/AssetRestrictionCest.php rename to tests/Functional/Restriction/AssetRestrictionCest.php index e87abd9c..822385ba 100644 --- a/tests/functional/Restriction/AssetRestrictionCest.php +++ b/tests/Functional/Restriction/AssetRestrictionCest.php @@ -3,7 +3,7 @@ namespace DachcomBundle\Test\functional\Restriction; use Codeception\Exception\ModuleException; -use DachcomBundle\Test\FunctionalTester; +use DachcomBundle\Test\Support\FunctionalTester; class AssetRestrictionCest { diff --git a/tests/functional/Restriction/DocumentRestrictionCest.php b/tests/Functional/Restriction/DocumentRestrictionCest.php similarity index 98% rename from tests/functional/Restriction/DocumentRestrictionCest.php rename to tests/Functional/Restriction/DocumentRestrictionCest.php index a1c3d8ae..2069c9f1 100644 --- a/tests/functional/Restriction/DocumentRestrictionCest.php +++ b/tests/Functional/Restriction/DocumentRestrictionCest.php @@ -3,7 +3,7 @@ namespace DachcomBundle\Test\functional\Restriction; use Codeception\Exception\ModuleException; -use DachcomBundle\Test\FunctionalTester; +use DachcomBundle\Test\Support\FunctionalTester; class DocumentRestrictionCest { diff --git a/tests/functional/Restriction/ObjectRestrictionCest.php b/tests/Functional/Restriction/ObjectRestrictionCest.php similarity index 99% rename from tests/functional/Restriction/ObjectRestrictionCest.php rename to tests/Functional/Restriction/ObjectRestrictionCest.php index 1ece9a1e..97ede9cd 100644 --- a/tests/functional/Restriction/ObjectRestrictionCest.php +++ b/tests/Functional/Restriction/ObjectRestrictionCest.php @@ -3,7 +3,7 @@ namespace DachcomBundle\Test\functional\Restriction; use Codeception\Exception\ModuleException; -use DachcomBundle\Test\FunctionalTester; +use DachcomBundle\Test\Support\FunctionalTester; class ObjectRestrictionCest { diff --git a/tests/functional/Validation/GetterCest.php b/tests/Functional/Validation/GetterCest.php similarity index 99% rename from tests/functional/Validation/GetterCest.php rename to tests/Functional/Validation/GetterCest.php index 97580d9c..d3527f73 100644 --- a/tests/functional/Validation/GetterCest.php +++ b/tests/Functional/Validation/GetterCest.php @@ -2,7 +2,7 @@ namespace DachcomBundle\Test\functional\Validation; -use DachcomBundle\Test\FunctionalTester; +use DachcomBundle\Test\Support\FunctionalTester; use DachcomBundle\Test\Util\MembersHelper; class GetterCest diff --git a/tests/functional/Validation/UniqueCest.php b/tests/Functional/Validation/UniqueCest.php similarity index 97% rename from tests/functional/Validation/UniqueCest.php rename to tests/Functional/Validation/UniqueCest.php index 66b1bd71..95072253 100644 --- a/tests/functional/Validation/UniqueCest.php +++ b/tests/Functional/Validation/UniqueCest.php @@ -2,7 +2,7 @@ namespace DachcomBundle\Test\functional\Validation; -use DachcomBundle\Test\FunctionalTester; +use DachcomBundle\Test\Support\FunctionalTester; use DachcomBundle\Test\Util\MembersHelper; class UniqueCest diff --git a/tests/functional/_bootstrap.php b/tests/Functional/_bootstrap.php similarity index 100% rename from tests/functional/_bootstrap.php rename to tests/Functional/_bootstrap.php diff --git a/tests/_support/AcceptanceTester.php b/tests/Support/AcceptanceTester.php similarity index 100% rename from tests/_support/AcceptanceTester.php rename to tests/Support/AcceptanceTester.php diff --git a/tests/_support/FunctionalTester.php b/tests/Support/FunctionalTester.php similarity index 100% rename from tests/_support/FunctionalTester.php rename to tests/Support/FunctionalTester.php diff --git a/tests/_support/Helper/Members.php b/tests/Support/Helper/Members.php similarity index 100% rename from tests/_support/Helper/Members.php rename to tests/Support/Helper/Members.php diff --git a/tests/_support/Helper/PimcoreBackend.php b/tests/Support/Helper/PimcoreBackend.php similarity index 100% rename from tests/_support/Helper/PimcoreBackend.php rename to tests/Support/Helper/PimcoreBackend.php diff --git a/tests/_support/Helper/PimcoreBundleCore.php b/tests/Support/Helper/PimcoreBundleCore.php similarity index 100% rename from tests/_support/Helper/PimcoreBundleCore.php rename to tests/Support/Helper/PimcoreBundleCore.php diff --git a/tests/_support/RestTester.php b/tests/Support/RestTester.php similarity index 100% rename from tests/_support/RestTester.php rename to tests/Support/RestTester.php diff --git a/tests/_support/Services/TestRestrictedStaticRouteListener.php b/tests/Support/Services/TestRestrictedStaticRouteListener.php similarity index 100% rename from tests/_support/Services/TestRestrictedStaticRouteListener.php rename to tests/Support/Services/TestRestrictedStaticRouteListener.php diff --git a/tests/_support/Test/DachcomBundleTestCase.php b/tests/Support/Test/DachcomBundleTestCase.php similarity index 100% rename from tests/_support/Test/DachcomBundleTestCase.php rename to tests/Support/Test/DachcomBundleTestCase.php diff --git a/tests/_support/Test/TestGroup.php b/tests/Support/Test/TestGroup.php similarity index 100% rename from tests/_support/Test/TestGroup.php rename to tests/Support/Test/TestGroup.php diff --git a/tests/_support/Test/TestUser.php b/tests/Support/Test/TestUser.php similarity index 100% rename from tests/_support/Test/TestUser.php rename to tests/Support/Test/TestUser.php diff --git a/tests/_support/UnitTester.php b/tests/Support/UnitTester.php similarity index 100% rename from tests/_support/UnitTester.php rename to tests/Support/UnitTester.php diff --git a/tests/_support/Util/MembersHelper.php b/tests/Support/Util/MembersHelper.php similarity index 100% rename from tests/_support/Util/MembersHelper.php rename to tests/Support/Util/MembersHelper.php diff --git a/tests/unit.suite.dist.yml b/tests/Unit.suite.dist.yml similarity index 79% rename from tests/unit.suite.dist.yml rename to tests/Unit.suite.dist.yml index 64850e17..227e1c30 100644 --- a/tests/unit.suite.dist.yml +++ b/tests/Unit.suite.dist.yml @@ -1,5 +1,5 @@ actor: UnitTester -error_level: 'getenv("PIMCORE_PHP_ERROR_REPORTING")' +error_level: '%PIMCORE_PHP_ERROR_REPORTING%' modules: enabled: - \Dachcom\Codeception\Helper\PimcoreCore: diff --git a/tests/unit/Config/ConfigurationTest.php b/tests/Unit/Config/ConfigurationTest.php similarity index 100% rename from tests/unit/Config/ConfigurationTest.php rename to tests/Unit/Config/ConfigurationTest.php diff --git a/tests/unit/Dao/GroupTest.php b/tests/Unit/Dao/GroupTest.php similarity index 89% rename from tests/unit/Dao/GroupTest.php rename to tests/Unit/Dao/GroupTest.php index c7a5d984..83c7dfc0 100644 --- a/tests/unit/Dao/GroupTest.php +++ b/tests/Unit/Dao/GroupTest.php @@ -14,7 +14,7 @@ class GroupTest extends DachcomBundleTestCase public function testGroupDaoEntity() { $group = $this->createUserGroup('group-1', ['ROLE_MEMBERS_MODERATOR']); - $storedGroup = MembersGroup::getById($group->getId(), true); + $storedGroup = MembersGroup::getById($group->getId(), ['force' => true]); $this->assertInstanceOf(MembersGroup::class, $group); $this->assertEquals(MembersHelper::DEFAULT_FEG_NAME, $storedGroup->getName()); diff --git a/tests/unit/Dao/SsoIdentityTest.php b/tests/Unit/Dao/SsoIdentityTest.php similarity index 97% rename from tests/unit/Dao/SsoIdentityTest.php rename to tests/Unit/Dao/SsoIdentityTest.php index e8ef7fb0..79197caf 100644 --- a/tests/unit/Dao/SsoIdentityTest.php +++ b/tests/Unit/Dao/SsoIdentityTest.php @@ -14,7 +14,7 @@ public function testSsoIdentityDaoEntity() { $ssoIdentity = $this->createSsoIdentity(true, 'google', '1234'); - $storedUser = SsoIdentity::getById($ssoIdentity->getId(), true); + $storedUser = SsoIdentity::getById($ssoIdentity->getId(), ['force' => true]); $this->assertInstanceOf(SsoIdentity::class, $storedUser); $this->assertEquals('google', $storedUser->getProvider()); diff --git a/tests/unit/Dao/UserTest.php b/tests/Unit/Dao/UserTest.php similarity index 93% rename from tests/unit/Dao/UserTest.php rename to tests/Unit/Dao/UserTest.php index f8735901..0b4532d8 100644 --- a/tests/unit/Dao/UserTest.php +++ b/tests/Unit/Dao/UserTest.php @@ -19,7 +19,7 @@ public function testUserDaoEntity() $group2 = $this->createUserGroup('group-2'); $user = $this->createUser(true, [$group1, $group2]); - $storedUser = MembersUser::getById($user->getId(), true); + $storedUser = MembersUser::getById($user->getId(), ['force' => true]); $this->assertInstanceOf(MembersUser::class, $user); $this->assertEquals(MembersHelper::DEFAULT_FEU_EMAIL, $storedUser->getEmail()); diff --git a/tests/unit/EventListener/AuthenticationListenerTest.php b/tests/Unit/EventListener/AuthenticationListenerTest.php similarity index 100% rename from tests/unit/EventListener/AuthenticationListenerTest.php rename to tests/Unit/EventListener/AuthenticationListenerTest.php diff --git a/tests/unit/EventListener/FlashListenerTest.php b/tests/Unit/EventListener/FlashListenerTest.php similarity index 100% rename from tests/unit/EventListener/FlashListenerTest.php rename to tests/Unit/EventListener/FlashListenerTest.php diff --git a/tests/unit/Manager/ClassManagerTest.php b/tests/Unit/Manager/ClassManagerTest.php similarity index 100% rename from tests/unit/Manager/ClassManagerTest.php rename to tests/Unit/Manager/ClassManagerTest.php diff --git a/tests/unit/Manager/LoginManagerTest.php b/tests/Unit/Manager/LoginManagerTest.php similarity index 100% rename from tests/unit/Manager/LoginManagerTest.php rename to tests/Unit/Manager/LoginManagerTest.php diff --git a/tests/unit/Manager/RestrictionManagerTest.php b/tests/Unit/Manager/RestrictionManagerTest.php similarity index 100% rename from tests/unit/Manager/RestrictionManagerTest.php rename to tests/Unit/Manager/RestrictionManagerTest.php diff --git a/tests/unit/Manager/SsoIdentityManagerTest.php b/tests/Unit/Manager/SsoIdentityManagerTest.php similarity index 100% rename from tests/unit/Manager/SsoIdentityManagerTest.php rename to tests/Unit/Manager/SsoIdentityManagerTest.php diff --git a/tests/unit/Manager/UserManagerTest.php b/tests/Unit/Manager/UserManagerTest.php similarity index 100% rename from tests/unit/Manager/UserManagerTest.php rename to tests/Unit/Manager/UserManagerTest.php diff --git a/tests/unit/Security/RoleOptionsProviderTest.php b/tests/Unit/Security/RoleOptionsProviderTest.php similarity index 100% rename from tests/unit/Security/RoleOptionsProviderTest.php rename to tests/Unit/Security/RoleOptionsProviderTest.php diff --git a/tests/unit/Security/UserCheckerTest.php b/tests/Unit/Security/UserCheckerTest.php similarity index 100% rename from tests/unit/Security/UserCheckerTest.php rename to tests/Unit/Security/UserCheckerTest.php diff --git a/tests/unit/Security/UserProviderTest.php b/tests/Unit/Security/UserProviderTest.php similarity index 100% rename from tests/unit/Security/UserProviderTest.php rename to tests/Unit/Security/UserProviderTest.php diff --git a/tests/unit/_bootstrap.php b/tests/Unit/_bootstrap.php similarity index 100% rename from tests/unit/_bootstrap.php rename to tests/Unit/_bootstrap.php diff --git a/tests/_etc/config.yml b/tests/_etc/config.yaml similarity index 100% rename from tests/_etc/config.yml rename to tests/_etc/config.yaml diff --git a/tests/_etc/config/app/config.yml b/tests/_etc/config/app/config.yaml similarity index 54% rename from tests/_etc/config/app/config.yml rename to tests/_etc/config/app/config.yaml index 8bce4a7a..ac916c74 100755 --- a/tests/_etc/config/app/config.yml +++ b/tests/_etc/config/app/config.yaml @@ -22,14 +22,37 @@ doctrine: enum: string bit: boolean +pimcore: + config_location: + image_thumbnails: + write_target: + type: 'settings-store' + video_thumbnails: + write_target: + type: 'settings-store' + document_types: + write_target: + type: 'settings-store' + predefined_properties: + write_target: + type: 'settings-store' + predefined_asset_metadata: + write_target: + type: 'settings-store' + perspectives: + write_target: + type: 'settings-store' + custom_views: + write_target: + type: 'settings-store' + object_custom_layouts: + write_target: + type: 'settings-store' + pimcore_admin: admin_csp_header: enabled: false -pimcore: - targeting: - enabled: false - framework: session: diff --git a/tests/_etc/config/app/routes.yaml b/tests/_etc/config/app/routes.yaml new file mode 100644 index 00000000..7b6b60fa --- /dev/null +++ b/tests/_etc/config/app/routes.yaml @@ -0,0 +1,5 @@ +_pimcore: + resource: '@PimcoreCoreBundle/config/routing.yaml' + +app: + resource: '@MembersBundle/config/pimcore/routing/all.yaml' \ No newline at end of file diff --git a/tests/_etc/config/app/routes.yml b/tests/_etc/config/app/routes.yml deleted file mode 100644 index 0db50e38..00000000 --- a/tests/_etc/config/app/routes.yml +++ /dev/null @@ -1,5 +0,0 @@ -_pimcore: - resource: '@PimcoreCoreBundle/Resources/config/routing.yml' - -app: - resource: '@MembersBundle/Resources/config/pimcore/routing/all.yml' \ No newline at end of file diff --git a/tests/_etc/config/app/security.yml b/tests/_etc/config/app/security.yaml similarity index 100% rename from tests/_etc/config/app/security.yml rename to tests/_etc/config/app/security.yaml diff --git a/tests/_etc/config/app/system.yml b/tests/_etc/config/app/system_settings.yaml similarity index 92% rename from tests/_etc/config/app/system.yml rename to tests/_etc/config/app/system_settings.yaml index 2480015c..52c55006 100755 --- a/tests/_etc/config/app/system.yml +++ b/tests/_etc/config/app/system_settings.yaml @@ -36,12 +36,6 @@ pimcore: email: debug: email_addresses: opensource@dachcom.ch - services: - google: - client_id: '' - email: '' - simple_api_key: '' - browser_api_key: '' full_page_cache: exclude_cookie: '' enabled: false diff --git a/tests/_etc/config/bundle/config_default.yml b/tests/_etc/config/bundle/config_default.yaml similarity index 100% rename from tests/_etc/config/bundle/config_default.yml rename to tests/_etc/config/bundle/config_default.yaml diff --git a/tests/_etc/config/bundle/config_reg_confirm_by_admin.yml b/tests/_etc/config/bundle/config_reg_confirm_by_admin.yaml similarity index 100% rename from tests/_etc/config/bundle/config_reg_confirm_by_admin.yml rename to tests/_etc/config/bundle/config_reg_confirm_by_admin.yaml diff --git a/tests/_etc/config/bundle/config_reg_confirm_by_admin_with_admin_notify.yml b/tests/_etc/config/bundle/config_reg_confirm_by_admin_with_admin_notify.yaml similarity index 100% rename from tests/_etc/config/bundle/config_reg_confirm_by_admin_with_admin_notify.yml rename to tests/_etc/config/bundle/config_reg_confirm_by_admin_with_admin_notify.yaml diff --git a/tests/_etc/config/bundle/config_reg_confirm_by_admin_with_after_confirmed.yml b/tests/_etc/config/bundle/config_reg_confirm_by_admin_with_after_confirmed.yaml similarity index 100% rename from tests/_etc/config/bundle/config_reg_confirm_by_admin_with_after_confirmed.yml rename to tests/_etc/config/bundle/config_reg_confirm_by_admin_with_after_confirmed.yaml diff --git a/tests/_etc/config/bundle/config_reg_confirm_instant.yml b/tests/_etc/config/bundle/config_reg_confirm_instant.yaml similarity index 100% rename from tests/_etc/config/bundle/config_reg_confirm_instant.yml rename to tests/_etc/config/bundle/config_reg_confirm_instant.yaml diff --git a/src/MembersBundle/Resources/translations/admin.de.yml b/translations/admin.de.yml similarity index 100% rename from src/MembersBundle/Resources/translations/admin.de.yml rename to translations/admin.de.yml diff --git a/src/MembersBundle/Resources/translations/admin.en.yml b/translations/admin.en.yml similarity index 100% rename from src/MembersBundle/Resources/translations/admin.en.yml rename to translations/admin.en.yml diff --git a/src/MembersBundle/Resources/translations/validators.de.yml b/translations/validators.de.yml similarity index 100% rename from src/MembersBundle/Resources/translations/validators.de.yml rename to translations/validators.de.yml diff --git a/src/MembersBundle/Resources/translations/validators.en.yml b/translations/validators.en.yml similarity index 100% rename from src/MembersBundle/Resources/translations/validators.en.yml rename to translations/validators.en.yml