Add separate property for social network registration
This commit is contained in:
@ -117,6 +117,10 @@ class Module extends BaseModule
|
||||
* @var bool whether to allow registration process or not
|
||||
*/
|
||||
public $enableRegistration = true;
|
||||
/**
|
||||
* @var bool whether to allow registration process for social network or not
|
||||
*/
|
||||
public $enableSocialNetworkRegistration = true;
|
||||
/**
|
||||
* @var bool whether to force email confirmation to
|
||||
*/
|
||||
|
||||
@ -48,7 +48,7 @@ class SocialNetworkAuthenticateService implements ServiceInterface
|
||||
public function run()
|
||||
{
|
||||
$account = $this->socialNetworkAccountQuery->whereClient($this->client)->one();
|
||||
if (!$this->controller->module->enableRegistration && ($account === null || $account->user === null)) {
|
||||
if (!$this->controller->module->enableSocialNetworkRegistration && ($account === null || $account->user === null)) {
|
||||
Yii::$app->session->setFlash('danger', Yii::t('usuario', 'Registration on this website is disabled'));
|
||||
$this->authAction->setSuccessUrl(Url::to(['/user/security/login']));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user