Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'emailConfirmation' => 'false', #124

Closed
Dunc80 opened this issue Jan 5, 2016 · 6 comments
Closed

'emailConfirmation' => 'false', #124

Dunc80 opened this issue Jan 5, 2016 · 6 comments

Comments

@Dunc80
Copy link

Dunc80 commented Jan 5, 2016

When I change this setting it makes no difference. I want users to be able to sign up and login to my site straight away.

/**
* @var bool If true, users will have to confirm their email address after registering (= email activation)
*/
public $emailConfirmation = true;

@amnah
Copy link
Owner

amnah commented Jan 7, 2016

What do you mean makes no difference - what doesn't work exactly?

@amnah
Copy link
Owner

amnah commented Jan 7, 2016

Just tried it on my dev machine and it's working fine. Gonna need more info from you.

@Dunc80
Copy link
Author

Dunc80 commented Jan 7, 2016

Hi, thanks for looking at this.
I have the following code in my config file. When I set 'emailConfirmation' as 'false' it still won't let a newly registered user login until clicking on the confirmation link in the email. This is exactly the same behaviour as when it is set as 'true'. I understood that this setting was supposed to eliminate the need for confirming the email before logging in.

'modules' => [
'user' => [
'class' => 'amnah\yii2\user\Module',
// set custom module properties here ...
'requireUsername' => 'true',
//'loginEmail' => 'false',
'emailConfirmation' => 'false',

                    'modelClasses'  => [
                        'ForgotForm' => 'app\models\MyForgotForm',
                        'LoginEmailForm' => 'app\models\MyLoginEmailForm', 
                        'User' => 'app\models\User',

                    ],
                ],
            ],

@amnah
Copy link
Owner

amnah commented Jan 7, 2016

Yes, it's supposed to. Your config looks correct, so I'm not really sure what's going on.

What classes have you extended/functions did you override?

Just to make sure, did you set the user component properly?

// config/web.php
    'components' => [
        'user' => [
            'class' => 'amnah\yii2\user\components\User',
        ],
    ]

@Dunc80
Copy link
Author

Dunc80 commented Jan 7, 2016

Yes I have the user component set properly. The only functions I have overridden were to change the subject of emails sent. I have just commented out the lines in my config file so it doesn't use my version of those classes and I still have the problem.
I am using this version - "amnah/yii2-user": "~4.0"

@amnah
Copy link
Owner

amnah commented Jan 7, 2016

Ok then I have no idea. You'll have to walk through the code and try to see what's happening, I can't do much but speculate from here as I cannot reproduce this.

The first part is setting the user attributes, which sets the $user->status (User::setRegisterAttributes()

https://github.com/amnah/yii2-user/blob/master/models/User.php#L345

Then it checks what that status is, and it sends an email if needed. ``DefaultController::afterRegister()`

https://github.com/amnah/yii2-user/blob/master/controllers/DefaultController.php#L252

Can you walk through/print_r and see what's happening?

@amnah amnah closed this as completed May 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants