Provides a user and role entity to work with ZfcUser, Doctrine 2 and BjyAuthorize
This module provides configuration and entities for ZfcUser, DoctrineORM and BjyAuthorize. The user entity also implements the LocaleUserInterface required by xelax90/zf2-language-route.
Installation of XelaxUserModule uses composer. For composer documentation, please refer to getcomposer.org.
composer require xelax90/zf-user-module
XelaxLanguageRoute to your
config/application.config.php and run
the doctrine schema update to create the database table:
php vendor/bin/doctrine-module orm:schema-tool:update --force
Now copy the provided
vendor/xelax90/zf-user-module/config/xelax-user-module.global.php into your
config/autoload directory. This file provides the basic configuration for
ZfcUser, DoctrineORM and BjyAuthorize to work with this module. This file does
not contain all ZfcUser configuration options. Please refer to the ZfcUser
for more details.
You can configure this module in the
file. All options are described there.
The user state in ZfcUser is enabled and is treated as a bitmask. The least
significant bit is always the 'Login Allowed' state. Other modules can use other
bits to store additional information. It is assumed, that only fife bits are used.
You can adjust this number in the
allowed_login_states configuration option.
If you want to add attributes to the user entity, you can simply follow these steps:
- Create your entity in your namespace and subclass
\XelaxUserEntity\Entity\User. Don't forget the Doctrine annotations
user_entity_classconfiguration option in
config/autoload/xelax-user-entity.global.phpto your entity class