mirror of
https://github.com/elyby/accounts.git
synced 2024-11-30 10:42:16 +05:30
Создаём событие о новом нике только при успешной регистрации
This commit is contained in:
parent
c828b8e1e6
commit
5a88229c2d
@ -3,6 +3,7 @@ namespace api\models\authentication;
|
|||||||
|
|
||||||
use api\models\AccountIdentity;
|
use api\models\AccountIdentity;
|
||||||
use api\models\base\KeyConfirmationForm;
|
use api\models\base\KeyConfirmationForm;
|
||||||
|
use api\models\profile\ChangeUsernameForm;
|
||||||
use common\models\Account;
|
use common\models\Account;
|
||||||
use common\models\EmailActivation;
|
use common\models\EmailActivation;
|
||||||
use Yii;
|
use Yii;
|
||||||
@ -34,6 +35,9 @@ class ConfirmEmailForm extends KeyConfirmationForm {
|
|||||||
throw new ErrorException('Unable activate user account.');
|
throw new ErrorException('Unable activate user account.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$changeUsernameForm = new ChangeUsernameForm();
|
||||||
|
$changeUsernameForm->createEventTask($account->id, $account->username, null);
|
||||||
|
|
||||||
$transaction->commit();
|
$transaction->commit();
|
||||||
} catch (ErrorException $e) {
|
} catch (ErrorException $e) {
|
||||||
$transaction->rollBack();
|
$transaction->rollBack();
|
||||||
|
@ -4,7 +4,6 @@ namespace api\models\authentication;
|
|||||||
use api\components\ReCaptcha\Validator as ReCaptchaValidator;
|
use api\components\ReCaptcha\Validator as ReCaptchaValidator;
|
||||||
use api\models\base\ApiForm;
|
use api\models\base\ApiForm;
|
||||||
use common\helpers\Error as E;
|
use common\helpers\Error as E;
|
||||||
use api\models\profile\ChangeUsernameForm;
|
|
||||||
use common\components\UserFriendlyRandomKey;
|
use common\components\UserFriendlyRandomKey;
|
||||||
use common\models\Account;
|
use common\models\Account;
|
||||||
use common\models\confirmations\RegistrationConfirmation;
|
use common\models\confirmations\RegistrationConfirmation;
|
||||||
@ -118,9 +117,6 @@ class RegistrationForm extends ApiForm {
|
|||||||
|
|
||||||
$this->sendMail($emailActivation, $account);
|
$this->sendMail($emailActivation, $account);
|
||||||
|
|
||||||
$changeUsernameForm = new ChangeUsernameForm();
|
|
||||||
$changeUsernameForm->createEventTask($account->id, $account->username, null);
|
|
||||||
|
|
||||||
$transaction->commit();
|
$transaction->commit();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$transaction->rollBack();
|
$transaction->rollBack();
|
||||||
|
Loading…
Reference in New Issue
Block a user