yii2-user
In developing. Use at your own risk
, (*1)
User Auth / DB-RBAC / AuthClient module stiled with Uikit Framework., (*2)
, (*3)
Installation
The preferred way to install this extension is through composer., (*4)
Either run, (*5)
php composer.phar require --prefer-dist worstinme/yii2-user
or add, (*6)
"worstinme/yii2-user": "^1.0.0"
to the require section of your composer.json
file., (*7)
Required configurations
'modules' => [
'user' => [
'class' => 'worstinme\user\Module',
],
'useradmin' => [
'class' => 'worstinme\user\backend\Module',
],
....
],
'components' => [
'user' => [
'class'=>'worstinme\user\User',
'identityClass' => 'worstinme\user\models\User',
'enableAutoLogin' => true,
'loginUrl'=>['/user/default/login'],
],
'authClientCollection' => [
'class' => 'yii\authclient\Collection',
'clients' => [
'google' => [
'class' => 'yii\authclient\clients\GoogleOpenId'
],
'facebook' => [
'class' => 'yii\authclient\clients\Facebook',
'clientId' => 'facebook_client_id',
'clientSecret' => 'facebook_client_secret',
],
// etc.
],
]
// ...
]
RBAC configurations
to web.php & console.php components section, (*8)
'authManager' => [
'class' => 'yii\rbac\DbManager',
],
]
& migrations, (*9)
$ yii migrate --migrationPath=@yii/rbac/migrations/
Then, use migrations to create user tables & default user administrator:administrator with admin role(don't forget to change it's default password)., (*10)
$ yii migrate --migrationPath=@worstinme/user/migrations/