yii2-module/yii2-user

A module to manage user authentication mechanisms


README

A module to manage user authentication mechanisms.

coverage build status

Installation

The installation of this library is made via composer. Download composer.phar from their website. Then add to your composer.json :

	"require": {
		...
		"yii2-module/yii2-user": "^3",
		...
	}

Then run php composer.phar update to install this library. The autoloading of all classes of this library is made through composer's autoloader.

Configuration

This module needs the following components to be set at the configuration level:

  • 'db_user' should be a \yii\db\Connection

If you already have a database connection, you may use the following trick :

'db_user' => function() { return \Yii::$app->get('db'); },

where 'db' is the id of your database connection.

This module uses the following parameters to be set at the configuration level:

  • NONE

Then the module should be configured as follows (in console.php or web.php) :

$config = [
	...
	'components' => [
		...
		'user' => [
			'class' => 'yii\web\User',
			'identityClass' => 'Yii2Module\Yii2User\Components\UserIdentity',
			'enableAutoLogin' => true,
			'loginUrl' => ['user/security/signup'],
		],
		'authManager' => [
			'class' => 'Yii2Module\Yii2User\Components\RbacManager',
		],
		...
	],
	...
	'modules' => [
		...
		'user' => [
			'class' => 'Yii2Module\Yii2User\UserModule',
		],
		...
	],
	...
];

Features

This module contains the following features :

Feature NameStatus
Auto Deletion Unregistered UsersIMPLEMENTED
Email Enqueing :IMPLEMENTED
> Inscription Confirmation EmailIMPLEMENTED
> Inscription Usurpation EmailPENDING
Login FormIMPLEMENTED
Login ConfirmationIMPLEMENTED
Registration FormIMPLEMENTED
Translation ENPENDING
Translation FRPENDING
Management of Users :PENDING
> Change of user statusPENDING
> Assignment of user to groupPENDING
> Removal of user from groupPENDING
> Assignment of access to userPENDING
> Removal of access to userPENDING
> Ban of usersPENDING
> Force user to reset passwordPENDING
> > Reset pwd information emailPENDING
> View all groups having userPENDING
> View all accesses having userPENDING
Management of Groups :PENDING
> Group CreationPENDING
> Group ModificationPENDING
> > Assignment of user to groupPENDING
> > Removal of user to groupPENDING
> > Assignment access to groupPENDING
> > Removal of access to groupPENDING
> Group SuppressionPENDING
> View all users of groupPENDING
> View all accesses of groupPENDING
Management of Accesses :PENDING
> Access Creation from ModulesPENDING
> Assignment of access to usersPENDING
> > Assignment information emailPENDING
> > Removal information emailPENDING
> Assignment of access to groupsPENDING
> > Assignment information emailPENDING
> > Removal information emailPENDING
> View all groups having accessPENDING
> View all users having accessPENDING

Here is the list of modules that served as inspiration source :

License

MIT (See license file)