This bundle provide a login frontend module allowing direct register the user if user not exist.
- PHP ^8.3
- Contao ^5.3
Install with contao manager or with composer:
composer require heimrichhannot/contao-login-registration-bundleUpdate the database.
- 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
PrepareNewMemberDataEventto provide a user email address.
| 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. |
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.
