Код: Выделить всё
public function validatePassword()
{
if (!$this->hasErrors()) {
$user = $this->getUser();
if (!$user || !$user->validatePassword($this->password)) {
$this->addError('password', Yii::t('frontend', 'Incorrect username or password.'));
}
}
}
Код: Выделить всё
<?php \yii\widgets\Pjax::begin(['enablePushState' => false]) ?>
<?php $form = ActiveForm::begin([
'action' => '/login',
'options' => [
'class' => 'subscription-form form-inline fadeInRight animated animated',
'enableClientValidation' => false,
'data-pjax' => true
],
]); ?>
<?= $form->field($model, 'identity', [
'options' => [
'class' => 'col-md-6',
],
])->textInput(['placeholder' => 'Логин или e-mail'])->label(false) ?>
<?= $form->field($model, 'password', [
'options' => [
'class' => 'col-md-6',
],
])->passwordInput(['placeholder' => 'Пароль'])->label(false) ?>
<div class="col-md-12" style="margin: 1em 0">
<?= Yii::t('frontend', 'If you forgot your password you can reset it <a class="reset-a" href="#">here</a>') ?>
</div>
<div class="col-md-12">
<div id="progress-button" class="progress-button">
<button>
<span><?= Yii::t('frontend', 'Login') ?></span>
</button>
<svg class="progress-circle" width="70" height="70">
<path d="m35,2.5c17.955803,0 32.5,14.544199 32.5,32.5c0,17.955803 -14.544197,32.5 -32.5,32.5c-17.955803,0 -32.5,-14.544197 -32.5,-32.5c0,-17.955801 14.544197,-32.5 32.5,-32.5z"/>
</svg>
<svg class="checkmark" width="70" height="70">
<path d="m31.5,46.5l15.3,-23.2"/>
<path d="m31.5,46.5l-8.5,-7.1"/>
</svg>
<svg class="cross" width="70" height="70">
<path d="m35,35l-9.3,-9.3"/>
<path d="m35,35l9.3,9.3"/>
<path d="m35,35l-9.3,9.3"/>
<path d="m35,35l9.3,-9.3"/>
</svg>
</div>
</div>
<?php ActiveForm::end(); ?>
<?php \yii\widgets\Pjax::end() ?>
Код: Выделить всё
echo Yii::$app->view->renderAjax('@frontend/modules/user/views/default/error');