A Yii 2.0 framework based user/account management module.
NOTE: This module requires composer package thinker-g/yii2-helpers
, please issue following command on main project to get dependencies.
php composer.phar require thinker-g/yii2-helpers
[Doc is under development.]
- Please setup
[[identityClass]]
of your "user" component tothinker_g\UserAuth\models\ars\User
so the backend of this module can manage users. - Setup
[[loginUrl]]
of your "user" component to['user-auth/auth/login]
, to allow the framework redirect users to the module's login page when login is needed, where theuser-auth
is the id you gave to this module in your application.
console/config/main.php
Used for creating the very first "super user", and grant super-agent accounts.
return [
'controllerMap' => [
// ...
'user' => [
'class' => 'thinker_g\UserAuth\console\UserCommand',
'userModel' => 'thinker_g\UserAuth\models\ars\User',
],
// ...
],
];
frontend/config/main.php
return [
// ...
'modules' => [
// begin - user
'user' => 'thinker_g\UserAuth\Module',
// ...
], // End of modules
// ...
];
backend/config/main.php
return [
// ...
'modules' => [
// begin - user
'user' => [
'class' => 'thinker_g\UserAuth\Module',
'controllerNamespace' => 'thinker_g\UserAuth\controllers\back',
'layout' => '@vendor/thinker-g/yii2-helpers/views/bs3/layouts/lsidebarmenu',
'mvMap' => [
'auth' => [
'login' => [
'model' => [
'class' => 'thinker_g\UserAuth\models\forms\LoginForm',
'passwordValidator' => ['validateAgentPassword'],
'rememberMe' => false,
],
],
],
], // end - user
// ...
], // End of modules
// ...
];