Yii2 user management module

Thank you for your reply Webvimark!

Just tried it: I commented the other user module but nothing changes.

Hi, lup0z. Sorry for the late answer, but I couldn’t replicate your problem, so I added mysql schema file to migrations folder.

If you can’t run migrations just export this schema to your database

Thank you so much Webvimark!

I’m doing again every step and when running “composer update”, I’ve found this out:

"Your requirements could not be resolved to an installable set of packages.

Problem 1

  • The request package webvimark/module-user-management could not be found in any version, there may be a typo in the package name.

Potential causes:

  • A typo in the package name

  • The package is not available in a stable-enough version according to your minimum-stability setting

see <https://groups.google.com/forum/#!topic/composer-dev/_g3ASeIFlrc/discussion>"

so something could change about my migration problem because of this issue?

The Pendalf posted how to solve this problem few comments above.

Try this code in your composer.json:

"minimum-stability": "dev",

"prefer-stable" : true,

Ah thank you.

I didn’t notice.

Sorry for the re-post of the problem

Ok, I just want to make you know that I succeed on downloading through your repository and when I run the migrate command, now I get this:


C:\xampp\htdocs\yiiframework\user-manager>php yii migrate --migrationPath=vendor/webvimark/module-user-management/migrations

Yii Migration Tool (based on Yii v2.0.3)


Total 10 new migrations to be applied:

        m140608_173539_create_user_table

        m140611_133903_init_rbac

        m140808_073114_create_auth_item_group_table

        m140809_072112_insert_superadmin_to_user

        m140809_073114_insert_common_permisison_to_auth_item

        m141023_141535_create_user_visit_log

        m141116_115804_add_bind_to_ip_and_registration_ip_to_user

        m141121_194858_split_browser_and_os_column

        m141201_220516_add_email_and_email_confirmed_to_user

        m141207_001649_create_basic_user_permissions


Apply the above migrations? (yes|no) [no]:yes

*** applying m140608_173539_create_user_table

Exception: Class webvimark\modules\UserManagement\UserManagementModule does not exist (C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\di\Container.php:415)

#0 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\di\Container.php(415): ReflectionClass->__construct('webvimark\modul...')

#1 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\di\Container.php(358): yii\di\Container->getDependencies('webvimark\modul..

.')

#2 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\di\Container.php(151): yii\di\Container->build('webvimark\modul...', Array,

 Array)

#3 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\BaseYii.php(344): yii\di\Container->get('webvimark\modul...', Array, Array)


#4 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\base\Module.php(354): yii\BaseYii::createObject(Array, Array)

#5 C:\xampp\htdocs\yiiframework\user-manager\vendor\webvimark\module-user-management\migrations\m140608_173539_create_user_table.php(16): yi

i\base\Module->getModule('user-management')

#6 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\db\Migration.php(81): m140608_173539_create_user_table->safeUp()

#7 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(492): yii\db\Migration->up()

#8 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(129): yii\console\controllers

\BaseMigrateController->migrateUp('m140608_173539_...')

#9 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)

#10 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\base\InlineAction.php(55): call_user_func_array(Array, Array)

#11 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\base\Controller.php(151): yii\base\InlineAction->runWithParams(Array)

#12 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\console\Controller.php(91): yii\base\Controller->runAction('', Array)

#13 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\base\Module.php(455): yii\console\Controller->runAction('', Array)

#14 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\console\Application.php(161): yii\base\Module->runAction('migrate', Array)


#15 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\console\Application.php(137): yii\console\Application->runAction('migrate'

, Array)

#16 C:\xampp\htdocs\yiiframework\user-manager\vendor\yiisoft\yii2\base\Application.php(375): yii\console\Application->handleRequest(Object(y

ii\console\Request))

#17 C:\xampp\htdocs\yiiframework\user-manager\yii(23): yii\base\Application->run()

#18 {main}

*** failed to apply m140608_173539_create_user_table (time: 0.019s)




Migration failed. The rest of the migrations are canceled.

Hey, as I can see you downloaded it directly instead of using composer (so I guess you’ll have problems with class autoload). For current problem you may use mysql.schema.sql in migrations/ folder.

If you’ll have futher troubles I’ll just create archive with whole project when I’ll be back from vacation and give you =)

No no, I downloaded it through "composer update".

Thank you for your support!

How can I set this behaviors for every controller (for the hole site ). It redirects to login page only when i rite this in controller//


public function behaviors()

{

    return [

        'ghost-access'=> [

            'class' => 'webvimark\modules\UserManagement\components\GhostAccessControl',

        ],

    ];

}

Hi @Vimark, exist an event triggered after a permission was denied?

I mean, I want to log when an user try to access at not permited action…

thanks and great job…

Dissident you can create a component basecontroller that extends from the main basecontroller

Hello,

How would you override the view for the module? I am currently attempting in config/web the following:





'view' => [

            'theme' => [

                'pathMap' => [

                    'vendor/webvimark/module-user-management/views/auth/' => '@app/views/module/user-management/auth/'

                ],

            ],

        ],



Thanks!

Hello,

So I was hoping to get this installed and am having some fun with it.

So just some information for you:

I downloaded the advanced template, I first tried to run the migration is said there was already a users table, so I renamed the old user table and migration ran fine.

however now i have this error:

6578

error.jpg

OK I got it! I had accidentally left he user component in from the Yii2 advanced application. Doh!

If the session runs in timeout, how can i set globally that after refresh the page to the login?

hi @Vimark,

I am installing the user management on “advanced template”. But it can’t find the config/console.php, where we put the migration configuration during installation. I know this is easy, but i am new to YII.

Same problem got me ;) Thanks for the tip now I can check it all out.

Sandy

Does anyone know if I’ll make changes in this module, including the views, then during the upgrade module (composer update) my changes made are lost?