Yii2 user management module

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?

Hi,

I want to custom views for login form, how can i do that ? I want to keep the update capabilities of the module.

Thanks

Hi,

I installed this for kartik-practical template, I put the user and module config on common/config/main.php,

However, every time I login it keeps coming back to login page. Any help?

On MSSQL i get the following error message when trying to apply the installation migrations:


*** applying m140611_133903_init_rbac

    > create table {{%auth_item_child}} ...Exception 'yii\db\Exception' with message 'SQLSTATE[42000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Introducing FOREIGN KEY constraint 'FK__auth_item__child__3CBF0154' on table 'auth_item_child' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.

The SQL being executed was: CREATE TABLE [auth_item_child] (

        [parent] varchar(64) NOT NULL,

        [child] varchar(64) NOT NULL,

        PRIMARY KEY (parent, child),

        FOREIGN KEY (parent) REFERENCES [auth_item] (name) ON DELETE CASCADE ON UPDATE CASCADE,

        FOREIGN KEY (child) REFERENCES [auth_item] (name) ON DELETE CASCADE ON UPDATE CASCADE

)'

Hello install the extension but although I think it works well no achievement view , the menu looks like a vertical list annexed image. I would also like to explain to me that I put in each controller to operate the extension. Thank you

I can not upload the image strip me the following error:

The server returned an error Error during upload.

But basically it is the menu that you place in views / layouts / main.php is displayed incorrectly as a list down, as if he were some css.

And the other query as mentioned above is know to be placed on each controller for the site to work through this extension