2017 © Pedro Peláez
 

yii2-extension yii2-p2y2-users

Users & RBAC modules.

image

p2made/yii2-p2y2-users

Users & RBAC modules.

  • Monday, April 16, 2018
  • by p2m
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 118 Forks
  • 0 Open issues
  • 5 Versions
  • 25 % Grown

The README.md

P2Y2 Users v0.2.2-beta

¡¡¡ ===== NOT READY FOR USE ===== !!!

Yii 2 Users & RBAC

Installation

The preferred way to install P2Y2 Users is through composer. Depending on your composer installation, run one of the following commands:, (*1)

    composer require p2made/yii2-p2y2-users "^0.2"

or, (*2)

    php composer.phar require p2made/yii2-p2y2-users "^0.2"

Alternatively add:, (*3)

    "p2made/yii2-p2y2-users": "^0.2"

to the requires section of your composer.json file & P2Y2 Users will be installed next time you run composer update., (*4)

And then...

  • Configure your database. Edit common/config/main-local.php in yii2-advanced-app, or app/config/db.php in yii2-basic-app, to include..., (*5)

    'components' => [
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=localhost;dbname=your_yii_app_db',
            'username' => 'your_yii_app_db_user',
            'password' => 'your_yii_app_db_password',
            'tablePrefix' => 'tbl_',
            'charset' => 'utf8',
        ],
        ...
    ],
    

    I recommend following the common practice of configuring the database with the username, your_yii_app_db_user, the same as the database name, your_yii_app_db., (*6)

  • Now edit common/config/main.php in yii2-advanced-app, or app/config/web.php in yii2-basic-app to include..., (*7)

    'components' => [
        'user' => [
            'class' => 'p2m\users\components\User',
        ],
        ...
    ],
    'modules' => [
        'user' => [
            'class' => 'p2m\users\modules\UsersModule',
        ],
        ...
    ],
    

    In yii2-advanced-app may have these configured at, (*8)

    • frontend/config/main.php &
    • backend/config/main.php. However since these will all be the same for both ends, it's best to keep only one copy in common/config. If there are user configurations in either of those files, remove them or comment them out.
  • Now configure the mailer..., (*9)

    • In yii2-advanced-app, either...
      • common/config/main.php or
      • common/config/main-local.php
    • In yii2-basic-app, app/config/web.php
    'components' => [
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'useFileTransport' => true,
            'messageConfig' => [
                'from' => ['admin@website.com' => 'Admin'],
                'charset' => 'UTF-8',
            ]
        ],
    ],
    
  • Optionally perform any customisation in common/config/params.php in yii2-advanced-app, or app/config/params.php in yii2-basic-app, to include..., (*10)

    ...
    'p2m' => [
        ...
        'users' => [
            'requireEmail' => true,
            'requireUsername' => false,
            'useEmail' => true,
            'useUsername' => true,
            'loginEmail' => true,
            'loginUsername' => true,
            'loginDuration' => 2551443, // one mean lunar month
            'emailConfirmation' => true,
            'emailChangeConfirmation' => true,
            'loginRedirect' => null,
            'logoutRedirect' => null,
            'resetExpireTime' => '2 days',
            'loginExpireTime' => '15 minutes',
            'usersEmailViewPath' => '@user/mail',
            'usersForceTranslation' => false,
            'usersModelClasses' => [],
        ],
    ],
    

    Settings above are the defaults & only need to be set if you want to change them. p2p is the params space for setting all of my Yii2 packages., (*11)

The Versions

16/04 2018

dev-0.2.2-beta

dev-0.2.2-beta

Users & RBAC modules.

  Sources   Download

MIT

The Requires

 

The Development Requires

user yii2 user management rbac users rbac module user module p2y2 yii2-p2y2-users yii2 module

16/04 2018

dev-master

9999999-dev

Users & RBAC modules.

  Sources   Download

MIT

The Requires

 

The Development Requires

user yii2 user management rbac users rbac module user module p2y2 yii2-p2y2-users yii2 module

17/04 2017

0.2.0

0.2.0.0

Users & RBAC modules.

  Sources   Download

MIT

The Requires

 

The Development Requires

user yii2 user management rbac users rbac module user module p2y2 yii2-p2y2-users yii2 module

02/04 2017

0.1.0

0.1.0.0

Users & RBAC modules.

  Sources   Download

MIT

The Requires

 

The Development Requires

user yii2 user management rbac users rbac module user module p2y2 yii2-p2y2-users yii2 module

30/03 2017

0.0.1

0.0.1.0

Users & RBAC modules.

  Sources   Download

MIT

The Requires

 

The Development Requires

user yii2 user management rbac users rbac module user module p2y2 yii2-p2y2-users yii2 module