2017 © Pedro Peláez
 

yii2-extension yii2-users-module

The users module for Yii framework.

image

vova07/yii2-users-module

The users module for Yii framework.

  • Thursday, February 19, 2015
  • by vova07
  • Repository
  • 9 Watchers
  • 25 Stars
  • 424 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 16 Forks
  • 7 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

Yii2 users module.

This module provide a users managing system for your yii2 application., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist vova07/yii2-users-module "*"

or add, (*4)

"vova07/yii2-users-module": "*"

to the require section of your composer.json file., (*5)

Configuration

Add yii2-users-module to module section of each application config:, (*6)

'modules' => [
    'users' => [
        'class' => 'vova07\users\Module',
        'requireEmailConfirmation' => false, // By default is true. It mean that new user will need to confirm their email address.
        'robotEmail' => 'my@robot.email', // E-mail address from that will be sent all `users` emails.
        'robotName' => 'My Robot Name', // By default is `Yii::$app->name . ' robot'`.
        'activationWithin' => 86400, // The time before a sent activation token becomes invalid.
        'recoveryWithin' => 14400, // The time before a sent recovery token becomes invalid.
        'recordsPerPage' => 10, // Users pe page.
        'adminRoles' => ['superadmin', 'admin'], // User roles that can access backend module.
    ]
]

Add or edit user component section:, (*7)

'user' => [
    'class' => 'yii\web\User',
    'identityClass' => 'vova07\users\models\User',
    'loginUrl' => ['/users/guest/login']  // For frontend app
    // 'loginUrl' => ['/users/admin/login']  // For backend app
]

Add or edit authManager component section:, (*8)

'authManager' => [
    'class' => 'yii\rbac\PhpManager',
    'defaultRoles' => [
        'user',
        'admin',
        'superadmin'
    ],
    'itemFile' => '@vova07/rbac/data/items.php',
    'assignmentFile' => '@vova07/rbac/data/assignments.php',
    'ruleFile' => '@vova07/rbac/data/rules.php',
]

Run module migration:, (*9)

php yii migrate --migrationPath=@vova07/users/migrations

Usage

Once the extension is installed, simply use it in your code by:, (*10)

Yii::$app->getModule('users');

By default will be created one superadmin user with login admin and password admin12345., (*11)

After installation you'll be able to access below links (relative to your site domain):, (*12)

Frontend:

  • /users/ - All users page
  • /users/admin/ - Admin page
  • /login/ - Log In page
  • /logout/ - Log Out page
  • /signup/ - Sign Up page
  • /recovery/ - Password recovery page
  • /resend/ - Resend email activation token
  • /activation/ - Accaunt activation page
  • /recovery-confirmation/ - Password reset page
  • /my/settings/email/ - Email change page
  • /my/settings/password/ - Password change page
  • /my/settings/update/ - Profile update page

Backend

You'll need to specify universal route '<_m>/<_c>/<_a>' => '<_m>/<_c>/<_a>' in your config file to access module actions. - /users/admin/login/ - Log In page - /users/admin/logout/ - Log Out page - /users/crud/index/ - All users page - /users/crud/view/ - User page - /users/crud/create/ - Create new user page - /users/crud/update/ - Update user page - /users/crud/delete/ - Delete one user - /users/crud/batch-delete/ - Delete more users, (*13)

Dependences

The Versions

19/02 2015

dev-master

9999999-dev

The users module for Yii framework.

  Sources   Download

BSD-3-Clause

The Requires

 

user profile yii2 module yii 2 management modules profiles account users

01/02 2015

0.1.3

0.1.3.0

The users module for Yii framework.

  Sources   Download

BSD-3-Clause

The Requires

 

user profile yii2 module yii 2 management modules profiles account users

31/01 2015

0.1.2

0.1.2.0

The users module for Yii framework.

  Sources   Download

BSD-3-Clause

The Requires

 

user profile yii2 module yii 2 management modules profiles account users

07/11 2014

0.1.1

0.1.1.0

The users module for Yii framework.

  Sources   Download

BSD-3-Clause

The Requires

 

user profile yii2 module yii 2 management modules profiles account users

04/08 2014

0.1.0

0.1.0.0

The users module for Yii framework.

  Sources   Download

BSD-3-Clause

The Requires

 

user profile yii2 module yii 2 management modules profiles account users