public function setUseYiiUser($value)
 {
     self::$useYiiUser = $value;
 }
 /**
  * Different form headers for different scenarios	
  * 
  * @access public
  * @return void
  */
 public function getHeader()
 {
     $header = '';
     switch ($this->scenario) {
         case 'both':
             $header = HOAuthAction::t('Please specify your nickname and email to end with registration.');
             break;
         case 'username':
             $header = HOAuthAction::t('Please specify your nickname to end with registration.');
             break;
         case 'email':
             $header = HOAuthAction::t('Please specify your email to end with registration.');
             break;
     }
     return "<p class=\"hFormHeader\">{$header}</p>";
 }
예제 #3
0
<?php

/**
 * @var HOAuthWidget $this
 * @var string       $provider name of provider
 */
$additionalClass = $this->onlyIcons ? 'icon' : '';
$invitation = Yii::app()->user->isGuest ? HOAuthAction::t('Sign in with') : HOAuthAction::t('Connect with');
?>
<a data-provider="<?php 
echo strtolower($provider);
?>
" class="<?php 
echo $additionalClass . ' ' . strtolower($provider);
?>
 btn btn-block button-submit button" href="<?php 
echo Yii::app()->createUrl($this->route . '/social', array('provider' => $provider));
?>
">
	<b><?php 
echo "{$provider}";
?>
</b>
</a>
예제 #4
0
<?php

/**
 * @var $sns array of array('provider' => $network->provider, 'profileUrl' => $network->profile->profileURL, 'deleteUrl' => $deleteUrl)
 */
?>
<ul class="hoauthSNList">
	<?php 
foreach ($sns as $sn) {
    list($provider, $profileUrl, $deleteUrl) = array_values($sn);
    echo '<li>' . CHtml::link($provider, $profileUrl, array('target' => '_blank')) . ' ' . CHtml::ajaxLink('(' . HOAuthAction::t('Remove') . ')', $deleteUrl, array('type' => 'post', 'context' => 'js:this', 'beforeSend' => "js:function() {return confirm('" . HOAuthAction::t('If you remove this social network account, you will you will not be able to login with it.\\n\\nDo you realy want to remove this account?') . "');}", 'success' => 'js:function() {$(this).parent().remove();}'), array('class' => "hoauthSNUnbind")) . '</li>';
}
?>
</ul>
예제 #5
0
 /**
  * Different form headers for different scenarios	
  * 
  * @access public
  * @return void
  */
 public function getHeader()
 {
     $header = '';
     switch ($this->scenario) {
         case 'both':
             $header = HOAuthAction::t('Please specify your ' . $this->getAttributeLabel('username') . ' and ' . $this->getAttributeLabel('email') . ' to end with registration.');
             break;
         case 'username':
             $header = HOAuthAction::t('Please specify your ' . $this->getAttributeLabel('username') . ' to end with registration.');
             break;
         case 'email':
             $header = HOAuthAction::t('Please specify your ' . $this->getAttributeLabel('email') . ' to end with registration.');
             break;
     }
     return "<p class=\"hFormHeader\">{$header}</p>";
 }
예제 #6
0
 /**
  * @access public
  * @return CForm instance
  */
 public function getForm()
 {
     if (!$this->_form) {
         $this->_form = new CForm(array('id' => strtolower(__CLASS__), 'elements' => array('<div class="form">', $this->header, 'username' => array('type' => 'text'), 'email' => array('type' => 'text'), 'password' => array('type' => 'password')), 'buttons' => array('submit' => array('type' => 'submit', 'label' => HOAuthAction::t('Submit')), '</div>'), 'activeForm' => array('id' => strtolower(__CLASS__) . '-form', 'enableAjaxValidation' => false, 'enableClientValidation' => true, 'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => true))), $this);
     }
     return $this->_form;
 }
예제 #7
0
 * View to display `yii-user` authentication errors
 * 
 * @var $errorCode error code from `yii-user` module UserIdentity class
 * @var $user current user model
 */
switch ($errorCode) {
    case UserIdentity::ERROR_STATUS_NOTACTIV:
        $error = HOAuthAction::t('must be activated! Check your email for details!');
        break;
    case UserIdentity::ERROR_STATUS_BAN:
        $error = HOAuthAction::t('is banned!');
        break;
}
?>
<div class="form">
	<div class="errorSummary">
		<p><b><?php 
echo HOAuthAction::t('Sorry, but your account');
?>
 <?php 
echo $error;
?>
!</b></p>
		<p>
			<?php 
echo CHtml::link(HOAuthAction::t('Return to main page'), '/') . ' | ' . CHtml::link(HOAuthAction::t('Return to login page'), Yii::app()->getModule('user')->loginUrl);
?>
		</p>
	</div>
</div>