Signs user up.

@return mixed
436737
public function actionSignup()
    {
        $model = new SignupForm();
        if ($model->load(Yii::$app->request->post()) && $model->signup()) {
            Yii::$app->session->setFlash('success', 'Thank you for registration. Please check your inbox for verification email.');
            return $this->goHome();
        }

        return $this->render('signup', [
            'model' => $model,
        ]);
    }
1350572
public function signup()
    {
        //Checks if signup is enabled
        if (!getConfig('users.signup')) {
            $this->Flash->error(I18N_DISABLED);

            return $this->redirect(['_name' => 'homepage']);
        }

        $user = $this->Users->newEntity();

        if ($this->request->is('post')) {
            $user = $this->Users->patchEntity($user, $this->request->getData());

            $user->group_id = getConfigOrFail('users.default_group');
            $user->active = (bool)!getConfig('users.activation');

            //Checks for reCAPTCHA, if requested
            if (!getConfig('security.recaptcha') || $this->Recaptcha->verify()) {
                if ($this->Users->save($user)) {
                    switch (getConfig('users.activation')) {
                        //The account will be enabled by an administrator
                        case 2:
                            $this->Flash->success(__d('me_cms', 'Account created, but it needs to be activated by an admin'));
                            break;
                        //The account will be enabled by the user via email
                        //  (default)
                        case 1:
                            //Sends the activation mail
                            $this->sendActivationMail($user);

                            $this->Flash->success(__d('me_cms', 'We send you an email to activate your account'));
                            break;
                        //No activation required, the account is immediately active
                        default:
                            $this->Flash->success(__d('me_cms', 'Account created. Now you can login'));
                            break;
                    }

                    return $this->redirect(['_name' => 'homepage']);
                }

                $this->Flash->error(__d('me_cms', 'The account has not been created'));
            } else {
                $this->Flash->error(__d('me_cms', 'You must fill in the {0} control correctly', 'reCAPTCHA'));
            }
        }

        $this->set(compact('user'));
        $this->viewBuilder()->setLayout('login');
    }
348598
protected function checkToken()
    {
        $query = $this->query;
        $signature = $this->sign(
            $this->token,
            isset($query['timestamp']) ? $query['timestamp'] : '',
            isset($query['nonce']) ? $query['nonce'] : ''
        );
        return isset($query['signature']) && $signature === $query['signature'];
    }
334311
public function MakeSign()
	{
		//签名步骤一：按字典序排序参数
		ksort($this->values);
		$string = $this->ToUrlParams();
		//签名步骤二：在string后加入KEY
		$string = $string . "&key=".WxPayConfig::$KEY;
		//签名步骤三：MD5加密
		$string = md5($string);
		//签名步骤四：所有字符转为大写
		$result = strtoupper($string);
		return $result;
	}
1297027
public function makeSign()
	{
		//签名步骤一：按字典序排序参数
		ksort($this->values);
		$string = $this->toUrlParams();
		//签名步骤二：在string后加入KEY
		$string = $string . '&key=' . Wxpay::getConfig('key');
		//签名步骤三：MD5加密
		$string = md5($string);
		//签名步骤四：所有字符转为大写
		$result = strtoupper($string);
		return $result;
	}
115564
public function authenticate()
    {

        $signer = new RequestSigner();
        $signer->setProvider('USF');
        $authenticator = new RequestAuthenticator($signer, $this->_timeout);

        $key = $authenticator->authenticate($this->_requestWrapper, $this->_keyLoader);

        if ($key) {
            $this->principal = "[HMAC]".$key->getId();
            $this->attributes = [];
            return true;
        }

        return false;

    }
1040837
public static function signInAs($username)
	{
		$ip = self::getClientIp();
		$ua = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? $_SERVER['HTTP_USER_AGENT'] : '';
		$ts = date("U");
		$cu = self::getCurrentUsername();

		self::sessionWrite( array( 'username' => $username ) );
		self::reload();

		self::log( 'signinas ' . $username , $cu, $ts , $ip , $ua );
		self::save();

		return self::$auth['users'][ $username ];
	}
529111
public static function is_login(){
        $user = self::sessionGet('user');
        if (empty($user)) {
            return false;
        } else {
            return  self::sessionGet('user_sign') == self::data_auth_sign($user) ? $user : false;
        }
    }
1240060
public function sign()
    {
        $this->crt = new SignedCertificate();

        $this->_altConfiguration();

        //print_r($this->altNames);

        /*
        print_r([
            $this->certConfigure, $this->domainName()->get()
        ]);
        */

        $this->crt->setPrivateKey($this->_generatePK());


        $privKey = $this->crt->getPrivateKey();
        $this->crt->setCsr(openssl_csr_new($this->domainName()->get(), $privKey, $this->certConfigure));

        if (!$this->caName == null) {
            // If CA name is not null sign certificate with loaded CA certificate
            $this->crt->setSignedCert(openssl_csr_sign(
                $this->crt->getCsr(), $this->_getCaCert(), $this->_getCaKey(), $this->_getConfig('daysvalid'), $this->certConfigure, time()
            ));
        } else {
            /**
             * Else self sign certificate
             * Its important for ROOT Certification authority certificate
             */
            $this->crt->setSignedCert(openssl_csr_sign(
                $this->crt->getCsr(), null, $this->crt->getPrivateKey(), $this->_getConfig('daysvalid'), $this->certConfigure, time()
            ));
        }

        return $this;
    }
645959
protected function generateSignature()
    {
        $signature  = $this->getMerchantPassword();
        $signature .= $this->getMerchantId();
        $signature .= $this->getAcquirerId();

        return base64_encode( sha1($signature, true) );
    }
1326706
public function actionSignout() {
        Yii::$app->user->logout();
        // redirect
        $logoutRedirect = $this->module->logoutRedirect;
        if ($logoutRedirect === null) {
            return $this->goHome();
        } else {
            return $this->redirect($logoutRedirect);
        }
    }
949070
public function register()
    {
        if ($this->validate()) {
            $class = $this->userClass;
            $user = new $class(['password' => $this->password]);
            /* @var $user User */
            $profile = $user->createProfile(['nickname' => $this->nickname, 'first_name' => $this->first_name, 'last_name' => $this->last_name, 'gender' => $this->gender]);
            $models[] = $profile;
            if (is_string($this->username)) {
                $username = $user->createUsername($this->username);
                $models[] = $username;
            }
            $result = $user->register($models);
            if ($result == true) {
                $this->model = $user;
            }
            return $result;
        }
        return false;
    }
754964
public function actionSignup()
    {
        $this->layout = '@vendor/cubiclab/admin-cube/views/layouts/signin';

        $user = new User(['scenario' => 'register']);

        // if register action is triggered
        if ($user->load(Yii::$app->request->post())) {
            if ($user->validate()) {

                if ($user->save(false)) {
                    Yii::$app->user->login($user);
                    Yii::$app->session->setFlash('success', 'Register success');

                    return $this->goHome();
                } else {
                    Yii::$app->session->setFlash('danger', 'Register error');
                    return $this->refresh();
                }
            } elseif (Yii::$app->request->isAjax) {
                Yii::$app->response->format = Response::FORMAT_JSON;
                return ActiveForm::validate($user);
            }
        }

        // render view
        return $this->render(
            'signup',
            [
                'user' => $user
            ]
        );
    }
1217256
public function authenticate()
	{
		// Backwards compatibility for Contao 4.4
		if (!$this instanceof UserInterface) {
			if ($this->frontendHelperUserAuthenticated === null) {
				$this->frontendHelperUserAuthenticated = \User::authenticate();
			}
			return $this->frontendHelperUserAuthenticated;
		}

		return $this->username && $this->intId;
	}
385626
public function sign($uri)
    {
        $url = parse_url($uri);
        if (isset($url['query'])) {
            parse_str($url['query'], $params);
        } else {
            $params = [];
        }

        $uri = $this->buildUrl($url, $params);
        $params[$this->parameter] = $this->computeHash($uri);

        return $this->buildUrl($url, $params);
    }
962319
public function login() {
        if ($this->request->is('post')) {
            $user = $this->Auth->identify();
            if ($user) {
                $this->Auth->setUser($user);
                return $this->redirect($this->Auth->redirectUrl());
            }
            $this->Flash->error(__('Your username or password is incorrect.'));
        }

        // Set signin layout from Builder.Layout
        $this->viewBuilder()->layout('signin');
        // Use the layout without Template 
        $this->render(false);
    }
88046
public function signup()
    {
        if ($this->validate()) {
            $class = Yii::$app->getUser()->identityClass ? : 'mdm\admin\models\User';
            $user = new $class();
            $user->username = $this->username;
            $user->email = $this->email;
            $user->status = ArrayHelper::getValue(Yii::$app->params, 'user.defaultStatus', UserStatus::ACTIVE);
            $user->setPassword($this->password);
            $user->generateAuthKey();
            if ($user->save()) {
                return $user;
            }
        }

        return null;
    }