- User management module for Yii 2
- Configuration and stuff on the project page
- Bug reports and feedback
User management module for Yii 2 ¶
Perks ¶
- User management
- RBAC (roles, permissions and stuff) with web interface
- Registration, authorization, password recovery and so on
- Visit log
- Optimised (zero DB queries during usual user workflow)
- Nice widgets like GhostMenu or GhostHtml::a where elements are visible only if user has access to route where they point
Installation ¶
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist webvimark/module-user-management "*"
or add
"webvimark/module-user-management": "*"
to the require section of your composer.json
file.
Configuration and stuff on the project page ¶
https://github.com/webvimark/user-management
P.S. because syntax here differs from github and I'm to lazy to rewrite it
Plan ¶
This is development version, so to make it production I need to do:
- Refactoring, refactoring and more refactoring
- Automated tests
- Integration with social networks
Error when using SQL Server
Thank you for the nice module
I have tried to install in Yii2 advanced template, connected with SQL server, and the driver am using is sqlsrv.
I getting the following error when I run migration
"Microsoft ODBC Driver 11 Exception for SQL server Transaction that was started in MARS batch is still active at the end of the batch. Transaction is rolled back "
Is there any one who has encountered a similar error?
Re: Error when using SQL Server
I guess it's because there are safeUp in migrations (which is also triggering transaction).
I'll fix it when I'll be near computer.
But have to warn you that this module is not fully compatible with Yii2 advanced template and has never been tested with it
Error when using SQL Server
Thank you Vimark
I have tried to connect with mysql database migration works. So I decided to create the tables manually in SQL server by converting the mysql script, the module appeared to work.
Now the links "Password Recovery" and "Registration" are redirecting me to the home page even if I try them accessing as a guest.
Re: Error when using SQL Server
By default they are disabled (no permissions for them)
You have to add them to "commonPermission" - http://yoursite.com/user-management/permission/index
cannot login as superadmin
i use yii2 advance. migration works. and i change SiteController into :
public function behaviors() { return [ 'ghost-access'=> [ 'class' => 'webvimark\modules\UserManagement\components\GhostAccessControl', ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ 'logout' => ['post'], ], ], ]; }
i can not login into application. in the debug mode i found "SELECT * FROM
user
WHERE (id
=1) AND (status
=10)". why status is 10 and not 1. and how to fix this.thank you.
cannot login as superadmin solution
I had the same issue as rhigel. The solution was simple. I'm using the yii2-advanced template as base and in the backend/config/main.php and frontend/config/main.php I commented the following lines:
'user' => [ 'identityClass' => 'common\models\User', 'enableAutoLogin' => true, ],
After that it worked for me.
Great Module!
Running this on a simple 'Basic' template App and was up in running very quickly. Simple interface and nice easy integration.
Sandy
Not able to access this
Hello,
I done as per read me file.
Installed this by composer,added
return [ 'ghost-access'=> [ 'class' => 'webvimark\modules\UserManagement\components\GhostAccessControl',
],
in site controller.
echo GhostMenu::widget([ 'encodeLabels'=>false, 'activateParents'=>true, 'items' => [ [ 'label' => 'Backend routes', 'items'=>UserManagementModule::menuItems() ], [ 'label' => 'Frontend routes', 'items'=>[ ['label'=>'Login', 'url'=>['/user-management/auth/login']], ['label'=>'Logout', 'url'=>['/user-management/auth/logout']], ], ], ], ]);
on login action
i checked in database, tables are created and in User table, superadmin user is present as user.
but when i go to login page , it gives me error of
Getting unknown property: yii\web\User::isSuperadmin
what I have missed here?
I am using Basic template
Adding fields to the database table and methods to the model of Yii 2-User Extension
While looking for an extension that will simplify things, I find this yii2-user.dmeroff.ru/docs - Dektrium project and would like to add what are important for me miss in the model and table.
First of all , I have my user table(model) in my database but after
passing throught your extension I found it coul really help me but the
problem I have is in my table a part from user id, name,email,profile
photo(for comment(thumbnail) and profile) and password field I have
also gender,telephone number(which the user can use to log in) and my
user model has other methods too. how can I handle that using your
extension?
Secondly, I want to put the log in view and sign up view at the same
time on the main layout(kind of using them as blocks), How can I do
that?
Does it support Internationalization?how?
Thanks for the help
fa icon not showing
Hi,
I am using kartik yii-practical as base, and I can make this extension works!
However, I see that the icons for backend routes, which are fa icons are not showing.
Any help?
Re: fa icon not showing
try to set
'encodeLabels' => false,
under your Nav::widget()
how can i install and use module
Hi,
i try your tutorial about installaiton and usage in your github account step by step.
i ran the command and it works.
"composer require --prefer-dist webvimark/module-user-management 1.0.7"
i add the your code in my config/web.php file
'components'=>[ 'user' => [ 'class' => 'webvimark\modules\UserManagement\components\UserConfig', // Comment this if you don't want to record user logins 'on afterLogin' => function($event) { \webvimark\modules\UserManagement\models\UserVisitLog::newVisitor($event->identity->id); } ], ], 'modules'=>[ 'user-management' => [ 'class' => 'webvimark\modules\UserManagement\UserManagementModule', // 'enableRegistration' => true, // Here you can set your handler to change layout for any controller or action // Tip: you can use this event in any module 'on beforeAction'=>function(yii\base\ActionEvent $event) { if ( $event->action->uniqueId == 'user-management/auth/login' ) { $event->action->controller->layout = 'loginLayout.php'; }; }, ], ],
and
i add the your code in my config/console.php
'modules'=>[ 'user-management' => [ 'class' => 'webvimark\modules\UserManagement\UserManagementModule', 'controllerNamespace'=>'vendor\webvimark\modules\UserManagement\controllers', // To prevent yii help from crashing ], ],
but i try to run the command step 3
"./yii migrate --migrationPath=vendor/webvimark/module-user-management/migrations/"
i take a error
"Migration failed.Directory specified in migrationPATh doesn't exist: cendor/webvimark/module-user-management/migrations/"
but i still go step 4
and i add in sitecontroller.php
public function behaviors() { return [ 'ghost-access'=> [ 'class' => 'webvimark\modules\UserManagement\components\GhostAccessControl', ], ]; }
i try to connect my page, i take error
"Class webvimark\modules\UserManagement\components\UserConfig does not exist"
i use ubuntu16.
there are 3 webvimark directory
in /home/ubuntu16/vendor/webvimark/
and /var/www/html/proje2/vendor/UserManagement
and /var/www/html/proje2/vendor/webvimark/
what should i do?
Thanks.
Guys, where is @webvimark ?
Is he alive? Who is maintaining this project?
The last merged pull request was in 2016, we've got 10 new opened merge requests and a lot of opened issues.
I just forked that and I'm planning to maintain this if he doesn't appear...
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.