2017 © Pedro Peláez
 

yii2-extension yii2-users-module

Fork from vova07/yii2-users-module The users module for Yii framework.

image

zpearl/yii2-users-module

Fork from vova07/yii2-users-module The users module for Yii framework.

  • Thursday, July 21, 2016
  • by zpearl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 16 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % 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 zpearl/yii2-users-module "*"

or add, (*4)

"zpearl/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' => 'zpearl\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' => 'zpearl\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' => '@zpearl/rbac/data/items.php',
    'assignmentFile' => '@zpearl/rbac/data/assignments.php',
    'ruleFile' => '@zpearl/rbac/data/rules.php',
]

Run module migration:, (*9)

php yii migrate --migrationPath=@zpearl/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

21/07 2016

dev-master

9999999-dev

Fork from vova07/yii2-users-module The users module for Yii framework.

  Sources   Download

BSD-3-Clause

The Requires

 

by Pestov Eugen

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