diff --git a/mirzaev/skillparts/system/controllers/RegistrationController.php b/mirzaev/skillparts/system/controllers/RegistrationController.php index b3f2f91..95ae540 100644 --- a/mirzaev/skillparts/system/controllers/RegistrationController.php +++ b/mirzaev/skillparts/system/controllers/RegistrationController.php @@ -32,8 +32,6 @@ class RegistrationController extends Controller if ($type === 'registration' && (!yii::$app->user->isGuest || $model->registration())) { // Данные прошли проверку и аккаунт был создан - echo 1; die; - // Аутентификация $model->scenario = $model::SCENARIO_AUTHENTICATION; diff --git a/mirzaev/skillparts/system/controllers/VerifyController.php b/mirzaev/skillparts/system/controllers/VerifyController.php index a57c20c..1a945e8 100644 --- a/mirzaev/skillparts/system/controllers/VerifyController.php +++ b/mirzaev/skillparts/system/controllers/VerifyController.php @@ -16,7 +16,7 @@ class VerifyController extends Controller if (isset($vrfy)) { // Подтверждение регистрации - if (Account::verification($vrfy)) { + if (Account::verification($vrfy, auth: true)) { // Успешно подтверждена регистрация return $this->redirect('/'); diff --git a/mirzaev/skillparts/system/models/Account.php b/mirzaev/skillparts/system/models/Account.php index 442cc3d..baff2be 100644 --- a/mirzaev/skillparts/system/models/Account.php +++ b/mirzaev/skillparts/system/models/Account.php @@ -312,7 +312,7 @@ class Account extends Document implements IdentityInterface, PartnerInterface /** * Подтверждение регистрации */ - public static function verification(string $vrfy): bool + public static function verification(string $vrfy, bool $auth = false): bool { if ($account = static::findByVrfy($vrfy)) { // Аккаунт найден @@ -321,7 +321,16 @@ class Account extends Document implements IdentityInterface, PartnerInterface $account->vrfy = true; // Отправка изменений - return $account->update() > 0 ? true : false; + $updated = $account->update() > 0; + + if ($updated && $auth) { + // Регистрация была подтверждена, а так же запрошена автоматическая аутентификация + + // Аутентификация + yii::$app->user->login($account, true ? 3600 * 24 * 30 : 0); + } + + return $updated; } return false; diff --git a/mirzaev/skillparts/system/views/account/index.php b/mirzaev/skillparts/system/views/account/index.php index 1aa2743..edd352c 100644 --- a/mirzaev/skillparts/system/views/account/index.php +++ b/mirzaev/skillparts/system/views/account/index.php @@ -72,18 +72,20 @@ use app\models\AccountForm; diff --git a/mirzaev/skillparts/system/views/account/panel/authenticated.php b/mirzaev/skillparts/system/views/account/panel/authenticated.php index 0e5f0ae..4787288 100644 --- a/mirzaev/skillparts/system/views/account/panel/authenticated.php +++ b/mirzaev/skillparts/system/views/account/panel/authenticated.php @@ -11,7 +11,7 @@ use yii;
$delivery_icon $delivery дн
+$delivery_icon ~$delivery дн
= nl2br(Html::encode($description)) ?>
Ваш пароль: "= $password ?? 'Ошибка' ?>"
+Ваш пароль: = $password ?? 'Ошибка' ?>
Нажимая на кнопку ниже вы соглашаетесь с политикой конфиденциальности Принять и подтвердить