Download the PHP package greeneffect/contao-email-login-bundle without Composer

On this page you can find all versions of the php package greeneffect/contao-email-login-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package contao-email-login-bundle

greeneffect/contao-email-login-bundle

Version française

Lets Contao members register and log in using their e-mail address.

Principle

Contao can only authenticate a member through tl_member.username (Contao\User::loadUserByIdentifier() runs a SELECT ... WHERE username = ?). Rather than decorating the user provider — which would touch the security layer — this bundle fills username with the e-mail address. Authentication, the session, "remember me" and 2FA therefore keep working with the native code, without any override.

What the bundle does

File Role
src/Module/DerivesUsernameFromEmailTrait.php Overrides ModuleRegistration::createNewUser() to inject username = email before the member is saved.
src/Module/ModuleEmailRegistration.php Applies the trait to the native registration module.
contao/config/config.php Replaces $GLOBALS['FE_MOD']['user']['registration'] with this module.
src/Module/EmailRegistrationController.php Applies the trait to the Notification Center registration module (see below).
contao/dca/tl_member.php username becomes varchar(255) NULL (without BINARY) and optional.
src/EventListener/SynchronizeUsernameListener.php Realigns username with email on every save (back end and "Personal data" module).
src/EventListener/LoginTemplateListener.php Replaces the "Username" label with "E-mail address" on the login form.

Removing the BINARY flag is essential: it made the SQL comparison case-sensitive, so a member typing [email protected] would not have been able to log in. The identifier is also normalized to lowercase on write (EmailIdentifier::fromEmail()).

Notification Center

The "Registration (Notification Center)" module is not an override of the native module but a distinct module type (registrationNotificationCenter), registered as a fragment via #[AsFrontendModule]. Replacing $GLOBALS['FE_MOD']['user']['registration'] therefore has no effect on it: it needs its own override.

EmailRegistrationController extends RegistrationController and declares the same fragment type with a higher priority. Contao only keeps one service per fragment type, the one with the highest priority (RegisterFragmentsPass) — so the override does not depend on bundle load order.

The dependency is optional: GreenEffectEmailLoginBundle::loadExtension() only imports config/services_notification_center.yaml if the upstream class exists. Without the Notification Center, the bundle works identically on the native module alone.

The service arguments mirror those of the Notification Center's config/modules.php. If a future version changes its constructor, container compilation will fail explicitly — this is intentional.

Registration module configuration

In the back end, on the registration module — native or Notification Center — only check email and password in the editable fields. The username field must not appear there: it would be shown to the visitor even though it is derived from the e-mail address.

The "Allow login" option (reg_allowLogin) must stay enabled, otherwise newly created accounts will not be able to log in.

Installation

The migration alters the tl_member.username column. Review the proposed SQL before confirming: if existing members have identifiers that only differ by case, the case-insensitive collation will make the unique index fail — duplicates need to be fixed beforehand.

Behaviors to know

License

CC BY-SA 4.0


All versions of contao-email-login-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
contao/core-bundle Version ^5.7
doctrine/dbal Version ^4.0
symfony/config Version ^7.4
symfony/dependency-injection Version ^7.4
symfony/http-kernel Version ^7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package greeneffect/contao-email-login-bundle contains the following files

Loading the files please wait ...