frontend/models/forms/SelfHostUserForm.php
/**
     * Signs user up.
     *
     * @return Users|null the saved model or null if saving fails
     */
Signs user up.
@return Users|null the saved model or null if saving fails
Signs user up . @return Users|null the saved model or null if saving fails
public function signup()
    {
        $user              = new SelfHostUsers();
        $user->shu_company = $this->shu_company;
        $user->shu_name    = $this->shu_name;
        $user->shu_email   = $this->shu_email;
        $user->shu_status  = SelfHostUsers::STATUS_ACTIVE;
        $user->shu_role    = SelfHostUsers::ROLE_ROOT;
        $user->shu_support_status = $this->shu_support_status;
        $user->shu_brand_status   = $this->shu_brand_status;
        $user->setPassword($this->password);
        $user->generateAuthKey();
        $user->generatePasswordResetToken();
        if ($user->save()) {
            if ($user->shu_support_status || $user->shu_brand_status) {
            } else {
                MailTemplatesStatic::sendByKey(MailTemplatesStatic::template_key_newShuRegister, $user->shu_email, [
                    'user_name' => $user->shu_name,
                    'user_email' => $user->shu_email,
                    'download_shu_link' => Url::to(['/'], true),
                ]);
            }
            return [
                'user' => $user,
                'free' => (int) (!$user->shu_support_status && !$user->shu_brand_status),
            ];
        }
        return null;
    }
public function signup ( ) { $ user = new SelfHostUsers ( ) ; $ user -> shu_company = $ this -> shu_company ; $ user -> shu_name = $ this -> shu_name ; $ user -> shu_email = $ this -> shu_email ; $ user -> shu_status = SelfHostUsers :: STATUS_ACTIVE ; $ user -> shu_role = SelfHostUsers :: ROLE_ROOT ; $ user -> shu_support_status = $ this -> shu_support_status ; $ user -> shu_brand_status = $ this -> shu_brand_status ; $ user -> setPassword ( $ this -> password ) ; $ user -> generateAuthKey ( ) ; $ user -> generatePasswordResetToken ( ) ; if ( $ user -> save ( ) ) { if ( $ user -> shu_support_status || $ user -> shu_brand_status ) { } else { MailTemplatesStatic :: sendByKey ( MailTemplatesStatic :: template_key_newShuRegister , $ user -> shu_email , [ 'user_name' => $ user -> shu_name , 'user_email' => $ user -> shu_email , 'download_shu_link' => Url :: to ( [ '/' ] , true ) , ] ) ; } return [ 'user' => $ user , 'free' => ( int ) ( ! $ user -> shu_support_status && ! $ user -> shu_brand_status ) , ] ; } return null ; }
Signs user up.
Signs user up .
// емейл со ссылкой не отправляем и ставим флеш-мессадж о том что с ним скоро свяжутся // отправляем емейл со сслкой на скачивание архива и ставим об этом флеш-мессадж