2017 © Pedro Peláez
 

yii2-extension yii2-users

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

image

budyaga/yii2-users

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  • Wednesday, November 8, 2017
  • by budyaga
  • Repository
  • 7 Watchers
  • 39 Stars
  • 4,829 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 39 Forks
  • 7 Open issues
  • 21 Versions
  • 3 % Grown

The README.md

Yii2-users

Module for management users and their rights with the support of registration via social services and assigned to each user more than one social service., (*1)

Abilities

User registration and authorization by e-mail and via social networks with the ability to bind several different social networking accounts to a one account on the your site

Authorization widget OAuth keys manage widget, (*2)

Changing password

Changing password, (*3)

Recovering password

Recovering password, (*4)

Changing e-mail. Confirmation will be sent to the old and new address

Changing e-mai, (*5)

Editinig profile

Editinig profile, (*6)

Administation module for manage users

Admin module, (*7)

Editing RBAC structure and user rights via the GUI

Editing RBAC structure, (*8)

Editiong user permissions, (*9)

Installation

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

Either run, (*11)

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

or add, (*12)

"budyaga/yii2-users": "*"

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

Config

'user' => [
    'identityClass' => 'budyaga\users\models\User',
    'enableAutoLogin' => true,
    'loginUrl' => ['/login'],
],
'authClientCollection' => [
    'class' => 'yii\authclient\Collection',
    'clients' => [
        'vkontakte' => [
            'class' => 'budyaga\users\components\oauth\VKontakte',
            'clientId' => 'XXX',
            'clientSecret' => 'XXX',
            'scope' => 'email'
        ],
        'google' => [
            'class' => 'budyaga\users\components\oauth\Google',
            'clientId' => 'XXX',
            'clientSecret' => 'XXX',
        ],
        'facebook' => [
            'class' => 'budyaga\users\components\oauth\Facebook',
            'clientId' => 'XXX',
            'clientSecret' => 'XXX',
        ],
        'github' => [
            'class' => 'budyaga\users\components\oauth\GitHub',
            'clientId' => 'XXX',
            'clientSecret' => 'XXX',
            'scope' => 'user:email, user'
        ],
        'linkedin' => [
            'class' => 'budyaga\users\components\oauth\LinkedIn',
            'clientId' => 'XXX',
            'clientSecret' => 'XXX',
        ],
        'live' => [
            'class' => 'budyaga\users\components\oauth\Live',
            'clientId' => 'XXX',
            'clientSecret' => 'XXX',
        ],
        'yandex' => [
            'class' => 'budyaga\users\components\oauth\Yandex',
            'clientId' => 'XXX',
            'clientSecret' => 'XXX',
        ],
        'twitter' => [
            'class' => 'budyaga\users\components\oauth\Twitter',
            'consumerKey' => 'XXX',
            'consumerSecret' => 'XXX',
        ],
    ],
],
'urlManager' => [
    'enablePrettyUrl' => true,
    'showScriptName' => false,
    'rules' => [
        '/signup' => '/user/user/signup',
        '/login' => '/user/user/login',
        '/logout' => '/user/user/logout',
        '/requestPasswordReset' => '/user/user/request-password-reset',
        '/resetPassword' => '/user/user/reset-password',
        '/profile' => '/user/user/profile',
        '/retryConfirmEmail' => '/user/user/retry-confirm-email',
        '/confirmEmail' => '/user/user/confirm-email',
        '/unbind/<id:[\w\-]+>' => '/user/auth/unbind',
        '/oauth/<authclient:[\w\-]+>' => '/user/auth/index'
    ],
],
'authManager' => [
    'class' => 'yii\rbac\DbManager',
],

'modules' => [
    'user' => [
        'class' => 'budyaga\users\Module',
        'userPhotoUrl' => 'http://example.com/uploads/user/photo',
        'userPhotoPath' => '@frontend/web/uploads/user/photo'
    ],
],

Instead of XXX, you have to use yours values. To receive them, you must create applications on the social networks., (*14)

Client Registration address
vkontakte https://vk.com/editapp?act=create
google https://console.developers.google.com/project
facebook https://developers.facebook.com/apps
github https://github.com/settings/applications/new
linkedin https://www.linkedin.com/secure/developer
live https://account.live.com/developers/applications
yandex https://oauth.yandex.ru/client/new
twitter https://dev.twitter.com/apps/new

If you are using advanced template and Yandex client, then you have to add authClientCollection in configurations for frontend and backend applications. However Yandex client should be added to only one of the applications. The reason for this is that Yandex one application can work with only one domain, you can not add two different Callback URL on different domains., (*15)

Not all services returns all user data. Some of the data get the default settings, if the service does not return them., (*16)

Database migrations

yii migrate/up --migrationPath=@vendor/budyaga/yii2-users/migrations, (*17)

This migration create all necessary for the operation of the module tables and two users:, (*18)

E-mail Password
administrator@example.com administrator@example.com
moderator@example.com moderator@example.com

Usage

in main layout:, (*19)

use budyaga\users\components\AuthorizationWidget;
<?= AuthorizationWidget::widget() ?>

Signup: http://example.com/signup, (*20)

Profile: http://example.com/profile, (*21)

Restore password: http://example.com/requestPasswordReset, (*22)

Manage users: http://example.com/user/admin, (*23)

Manage RBAC: http://example.com/user/rbac, (*24)

Custom views and email templates

If you want use custom views and email templates you can override their in config. For example:, (*25)

'modules' => [
    'user' => [
        'class' => 'budyaga\users\Module',
        'customViews' => [
            'login' => '@app/views/site/login'
        ],
        'customMailViews' => [
            'confirmChangeEmail' => '@app/mail/confirmChangeEmail' //in this case you have to create files confirmChangeEmail-html.php and confirmChangeEmail-text.php in mail folder
        ]
    ],
],

You can override all views from vendor\budyaga\yii2-users\views\user and vendor\budyaga\yii2-users\mail folders., (*26)

The Versions

08/11 2017

dev-master

9999999-dev

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

08/11 2017

0.1.19

0.1.19.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

08/11 2017

0.1.18

0.1.18.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

02/11 2017

0.1.17

0.1.17.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

01/11 2017

0.1.16

0.1.16.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

09/04 2017

0.1.15

0.1.15.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

18/10 2016

0.1.14

0.1.14.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

25/06 2016

0.1.13

0.1.13.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

17/05 2016

0.1.12

0.1.12.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

26/04 2016

0.1.11

0.1.11.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

25/02 2016

0.1.10

0.1.10.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

24/02 2016

0.1.9

0.1.9.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

21/07 2015

0.1.8

0.1.8.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

18/07 2015

0.1.7

0.1.7.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

15/07 2015

0.1.6

0.1.6.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

13/07 2015

0.1.5

0.1.5.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

23/06 2015

0.1.4

0.1.4.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

18/06 2015

0.1.3

0.1.3.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

07/06 2015

0.1.2

0.1.2.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 module rbac users

07/06 2015

0.1.1

0.1.1.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 rbac users

07/06 2015

0.1.0

0.1.0.0

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

  Sources   Download

BSD-3-Clause

The Requires

 

by Sergey Krivochenko

extension oauth yii2 rbac users