Skip to content

worstinme/yii2-user

Folders and files

NameName
Last commit message
Last commit date

Latest commit

303ac72 ยท Jan 17, 2018

History

37 Commits
Jul 11, 2016
Jan 17, 2018
Jul 18, 2016
Jul 11, 2016
Jan 4, 2017
May 3, 2016
Oct 25, 2016
Jan 4, 2017
Oct 3, 2015
Oct 3, 2015
Jul 11, 2016
Jul 11, 2016
May 3, 2016
Jan 17, 2018
Feb 7, 2017

Repository files navigation

yii2-user

In developing. Use at your own risk

User Auth / DB-RBAC / AuthClient module stiled with Uikit Framework.

Latest Stable Version Total Downloads

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist worstinme/yii2-user

or add

"worstinme/yii2-user": "^1.0.0"

to the require section of your composer.json file.

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

    'authManager' => [
            'class' => 'yii\rbac\DbManager',
    ],
]

& migrations

$ 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).

$ yii migrate --migrationPath=@worstinme/user/migrations/

About

Yii2 user module

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages