private function renderLinkForm()
    {
        $this->layout = '//layouts/main';

		$this->setPageTitle(Yii::t('HybridAuth.main', '{{app_name}} | {{label}}', array(
			'{{app_name}}' => Cii::getConfig('name', Yii::app()->name),
            '{{label}}'    => Yii::t('HybridAuth.main', 'Link Your Account')
		)));

        $form = new RemoteLinkAccountForm;

        if (Cii::get($_POST, 'RemoteLinkAccountForm', false))
        {
            // Populate the model
            $form->attributes = Cii::get($_POST, 'RemoteLinkAccountForm', false);
            $form->provider   = $this->getProvider();
            $form->adapter    = $this->getUserProfile();

            if ($form->save())
            {
                if ($this->authenticate())
                {
                    Yii::app()->user->setFlash('success', Yii::t('HybridAuth.main', 'You have successfully logged in via {{provider}}', array('{{provider}}' => $this->getProvider() )));
                    $this->redirect(Yii::app()->user->returnUrl);
                }
            }
        }

        // Reuse the register form
        $this->render('/linkaccount', array('model' => $form));
    }
private function renderLinkForm()
    {
        $this->layout = '//layouts/main';

		$this->setPageTitle(Yii::t('HybridAuth.main', '{{app_name}} | {{label}}', array(
			'{{app_name}}' => Cii::getConfig('name', Yii::app()->name),
            '{{label}}'    => Yii::t('HybridAuth.main', 'Link Your Account')
		)));

        $form = new RemoteLinkAccountForm;

        if (Cii::get($_POST, 'RemoteLinkAccountForm', false))
        {
            // Populate the model
            $form->attributes = Cii::get($_POST, 'RemoteLinkAccountForm', false);
            $form->provider   = $this->getProvider();
            $form->adapter    = $this->getUserProfile();

            if ($form->save())
            {
                if ($this->authenticate())
                {
                    Yii::app()->user->setFlash('success', Yii::t('HybridAuth.main', 'You have successfully logged in via {{provider}}', array('{{provider}}' => $this->getProvider() )));
                    $this->redirect(Yii::app()->user->returnUrl);
                }
            }
        }

        // Reuse the register form
        $this->render('/linkaccount', array('model' => $form));
    }
private function renderLinkForm ( ) { $ this -> layout = '//layouts/main' ; $ this -> setPageTitle ( Yii :: t ( 'HybridAuth.main' , '{{app_name}} | {{label}}' , array ( '{{app_name}}' => Cii :: getConfig ( 'name' , Yii :: app ( ) -> name ) , '{{label}}' => Yii :: t ( 'HybridAuth.main' , 'Link Your Account' ) ) ) ) ; $ form = new RemoteLinkAccountForm ; if ( Cii :: get ( $ _POST , 'RemoteLinkAccountForm' , false ) ) { // Populate the model $ form -> attributes = Cii :: get ( $ _POST , 'RemoteLinkAccountForm' , false ) ; $ form -> provider = $ this -> getProvider ( ) ; $ form -> adapter = $ this -> getUserProfile ( ) ; if ( $ form -> save ( ) ) { if ( $ this -> authenticate ( ) ) { Yii :: app ( ) -> user -> setFlash ( 'success' , Yii :: t ( 'HybridAuth.main' , 'You have successfully logged in via {{provider}}' , array ( '{{provider}}' => $ this -> getProvider ( ) ) ) ) ; $ this -> redirect ( Yii :: app ( ) -> user -> returnUrl ) ; } } } // Reuse the register form $ this -> render ( '/linkaccount' , array ( 'model' => $ form ) ) ; }
Renders the linking form
Renders the linking form