heimrichhannot / contao-login-registration-bundle
A frontend module that allows login and registration in one module.
Installs: 83
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 0
Open Issues: 0
Type:contao-bundle
Requires
- php: ^8.1
- contao/core-bundle: ^4.13 || ^5.0
- symfony/event-dispatcher-contracts: ^1.0 || ^2.0 || ^3.0
- symfony/http-foundation: ^5.4 || ^6.0
- symfony/http-kernel: ^5.4 || ^6.0
- symfony/security-core: ^5.4 || ^6.0
- symfony/translation-contracts: ^1.0 || ^2.0 || ^3.0
Requires (Dev)
- contao/contao-rector: dev-main
- contao/core-bundle: ^4.13
- contao/manager-plugin: ^2.13
- phpstan/phpstan: ^1.12
- phpstan/phpstan-symfony: ^1.4
- rector/rector: ^1.2
- symplify/easy-coding-standard: ^12.5
README
This bundle provide a login frontend module allowing direct register the user if user not exist.
Usage
Install
Install with contao manager or with composer:
composer require heimrichhannot/contao-login-registration-bundle
Update the database.
Setup
- Create a frontend module of type "Login Registration".
- Add the module to a page.
- For ease of usage, it is recommended to only allow email addresses as username.
You could adjust your dca accordingly or use a bundle to provide such functionality.
Otherwise, you need to implement a listener for
PrepareNewMemberDataEvent
to provide a user email address.
Developers
PHP Events
Event | Description |
---|---|
AdjustUsernameEvent | Manipulate the username before checking for existing user or creating a new one. |
PrepareNewMemberDataEvent | Adjust the new member data before the member is created. |
BeforeParseModuleEvent | Manipulate the template data before rendering the frontend module. |
Exception handling
To pass an exception to the user, you can throw a \HeimrichHannot\LoginRegistrationBundle\Exception\InvalidRegistrationException
in your PrepareNewMemberDataEvent
or AdjustUsernameEvent
listener.
To adjust the message, that will be displayed to the use, use the BeforeParseModuleEvent
.