Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jan 23 2019 21:39
    WhatTheBuild starred 2amigos/yii2-usuario
  • Jan 21 2019 15:22
    qav-gabriela-castro starred 2amigos/yii2-usuario
  • Jan 17 2019 14:14
    ljfreelancer88 starred 2amigos/yii2-usuario
  • Jan 17 2019 07:40
    tsdogs opened #302
  • Jan 15 2019 15:59

    tonydspaniard on master

    Add nl_NL Dutch translation. Mi… Improve translations Merge pull request #301 from sq… (compare)

  • Jan 15 2019 15:59
    tonydspaniard closed #301
  • Jan 15 2019 15:57
    tonydspaniard commented #301
  • Jan 15 2019 15:05
    squio synchronize #301
  • Jan 15 2019 10:17
    squio opened #301
  • Jan 04 2019 13:40
    maxxer commented #298
  • Jan 04 2019 13:20
    theonedemon starred 2amigos/yii2-usuario
  • Jan 04 2019 12:50
    schmunk42 opened #298
  • Dec 31 2018 10:31
    maxxer closed #293
  • Dec 31 2018 10:31
    maxxer commented #293
  • Dec 31 2018 10:30

    maxxer on master

    Fix password expire service #293 (compare)

  • Dec 19 2018 15:34
    steelice starred 2amigos/yii2-usuario
  • Dec 19 2018 10:22
    tonydspaniard commented #289
  • Dec 19 2018 07:47
    bscheshirwork commented #289
  • Dec 18 2018 21:01
  • Dec 12 2018 16:35
    maxxer commented #289
Hello! Tell me please, when you turn on two-factor authorization, the ability to remember the authorization of the user is missed or so provided? (translate)
Rabesh Lal Shrestha
Helloo all
I need help related to permission and rules related to yii2 usuario
I am new to yii2-usuario
can anyone help me how to create rules and permission in that extension
Rabesh Lal Shrestha
Authentication rule class yii\rbac\Rule can not be instantiated
Amit Arya
@rabesh any solution??
Amit Arya
hello folks, have you guys encountered this problem??
John Goetz
Hello, I've used Dektrium yii2-user and yii2-rbac in previous projects but now am tasked with standing up a Yii2 Advanced Template with Usuario.
I have a couple of suggestions:
For your Advanced Template instructions the step to add Usuario to a freshly downloaded and configured Yii2 Advanced Template is missing. Could you add a "Composer require 2amigos/usuario" statement in your instructions? That would help users who are unfamiliar with Yii2 and composer.
After downloading and configuring the Advanced Template, including its migration steps, the Usuario migration fails because there's already a User table. I have to drop the existing User table (or modify the migration to drop it) before the Usuario migrations run. Perhaps your documentation could show that?
Thanks for your attention, and happy hacking!
John Goetz

Another comment about the instructions: The second migration, yii migrate --migrationPath=@yii/rbac/migrations, won't work unless the authManager has been configured. Could you add that to the Components section of the example in Step 2? This would help people who aren't familiar with RBAC and haven't configured Dektrium before.

About my previous comment where I mentioned the User table and failing the first migration. My apologies, I see now you have a note to not install the Advanced Template migration m130524_201442_init.php. However, if a user has already completed the Advanced Template setup, they will have already done this migration. Perhaps you could place a note above the mention of the Advanced Template to warn users not to perform the migrations as the Advanced Template instructions state, and if they have done so, to drop the table?
Again, thanks for listening.

John Goetz
Hello, has anyone successfully installed Yii2-usuario on the Advanced Template? We are running into problems that seem well beyond average. Any hints?
but is this project still to be considered alive?
It seems interesting but I met a lot of problems during its implementation...
Amit Arya
has anyone managed to change mail template contents after registration?
Pedro Luis Rodríguez Amador
how to generate admin full control role and permission ?
but is this project still to be considered alive?
Hey guys, any guide of how to add profile field(s) to registration form? Dektrium way doesn't work.
Guys, any possibility we are getting help with issue #124 ? 2amigos/yii2-usuario#124
...here I read messages, but someone can tell me if the project is usable or not? thanks
John Goetz
My colleague was finally able to get things working.
I don't see any responses from the maintainers; my guess is they aren't actively working on it any more.
It would be nice to have a small answer from them, or someone who went on with a fork this project.
Thiago Otaviani Vidal
hey guys
anyone online?
All online but for what?!
Thiago Otaviani Vidal
lol. sorry. never used gitter.
This amazing repo... Is dead!! Sigh
Amit Arya
Stefan Jacomeit
Hey, how can I use the extension to use jwt token for API calls?
Ron Jenkins
Anyone online?
I'm setting up 2amigos/yii2-usuario in the yii2 basic template, and I'm very close to having it working, but I'm missing something small :)
is there is any tutorial how to use the module?
@RonJenk99469709_twitter share please how?
@RonJenk99469709_twitter How what?
Benjamín Rivero
Hi all, I recently setup this extension and works great. What problem do you have @RonJenk99469709_twitter
How can get the user logged ?
does not work redirect after confirm user. Overriding model
'controllerMap' => [
    'confirm' => [
        'on ' . Da\User\Event\UserEvent::EVENT_AFTER_CONFIRMATION => function (Da\User\Event\UserEvent $event) {
I'm about to switch from dectrium user to Usuario.
My user has a role "admin".
Nevertheless I have no access to /user/admin.
If I replace 'admin' in the AdminController with any other role it works strangely.
Any idea where the problem is?
@maxxer Any idea?
Hi, I have installed the yii2 application as per your package with usuario and config kit
But it still seems to want to use the standard user model and not usuario
Lorenzo Milesi
@paskuale75 not really dead, come on :)
@virbus redirect must be called with return

I'm trying to use the recaptcha widget on the RegistrationForm just like I did on RecoveryForm, by following the website's guide. Everything is working fine except that, on the register form, I can't validate the captcha because it keeps saying "Captcha cannot be blank" due to the "required" rule shown in the image above.
Now, this doesn't happen on the Recovery form where I too have the "required" rule just like that. I can take the rule out of the code, but I wanted to keep it just like I can in the recovery form.

What am I missing? Is the RegistrationForm just different from the RecoveryForm and I should just remove the rule?


Pls, help me. The problem with authorization through social network new user. Return 404 /user/registration/connect?code=FMwHPLCI*DJC

    // Da\User\Controller\RegistrationController
    public function actionConnect($code)
        /** @var SocialNetworkAccount $account */
        $account = $this->socialNetworkAccountQuery->whereCode($code)->one();
        if ($account === null || $account->getIsConnected()) {
            throw new NotFoundHttpException(); // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!  social_account not saved
// Da\User\Service\SocialNetworkAuthenticateService
protected function createAccount()
        $data = $this->client->getUserAttributes();

        /** @var SocialNetworkAccount $account */
        $account = $this->controller->make(
                'provider' => $this->client->getId(),
                'client_id' => $data['id'],
                'data' => json_encode($data),
                'username' => $this->client->getUserName(),
                'email' => $this->client->getEmail(),
        // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! User not found => social_account not save
        if (($user = $this->getUser($account)) instanceof User) {
            $account->user_id = $user->id;

        return $account;

I tried all events. The problem is solved only this way, otherwise redirecting to 404

 'security' => [
                    'class' => 'Da\User\Controller\SecurityController',
                    'layout' => '@app/views/layouts/main_with_container',
                    // beforeAuthenticate
                    // afterAuthenticate
                    // beforeConnect
                    // afterConnect
                    'on beforeAuthenticate' => function($event){
                         /** @var Da\User\Event\SocialNetworkAuthEvent $event */

                        /** @var Da\User\Model\User $user */

                        if(Da\User\Model\User::find()->where(['email' => $event->client->email])->exists()) return;

                        $user = Yii::createObject([
                            'class' => Da\User\Model\User::class,
                            'scenario' => 'create',
                            'email' => $event->client->email,
                            'username' => $event->client->username,
                            'password' => null
                        $mailService = \Da\User\Factory\MailFactory::makeWelcomeMailerService($user);

                        $userCreateService = Yii::createObject([
                            'class' => \Da\User\Service\UserCreateService::class,
                        ], [$user, $mailService]);


                        $event->account->user_id = $user->id;