fix views
This commit is contained in:
@ -135,7 +135,8 @@ class SecurityController extends Controller
|
||||
$this->make(SocialNetworkAuthenticateService::class, [$this, $this->action, $client])->run();
|
||||
}
|
||||
|
||||
public function connect(AuthClientInterface $client) {
|
||||
public function connect(AuthClientInterface $client)
|
||||
{
|
||||
if (Yii::$app->user->isGuest) {
|
||||
Yii::$app->session->setFlash('danger', Yii::t('user', 'Something went wrong'));
|
||||
|
||||
|
||||
@ -199,7 +199,7 @@ class SettingsController extends Controller
|
||||
|
||||
public function actionDelete()
|
||||
{
|
||||
if (!$this->module->enableAccountDelete) {
|
||||
if (!$this->module->allowAccountDelete) {
|
||||
throw new NotFoundHttpException(\Yii::t('user', 'Not found'));
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,10 @@ class Module extends \yii\base\Module
|
||||
* @var bool whether to enable password recovery or not.
|
||||
*/
|
||||
public $allowPasswordRecovery = true;
|
||||
/**
|
||||
* @var bool Whether user can remove his account
|
||||
*/
|
||||
public $allowAccountDelete = false;
|
||||
/**
|
||||
* @var string the class name of the strategy class to handle user's email change.
|
||||
*/
|
||||
|
||||
55
lib/User/Widget/ConnectWidget.php
Normal file
55
lib/User/Widget/ConnectWidget.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace Da\User\Widget;
|
||||
|
||||
|
||||
use Yii;
|
||||
use yii\authclient\ClientInterface;
|
||||
use yii\authclient\widgets\AuthChoice;
|
||||
use yii\authclient\widgets\AuthChoiceAsset;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
|
||||
class ConnectWidget extends AuthChoice
|
||||
{
|
||||
/**
|
||||
* @var array|null An array of user's accounts
|
||||
*/
|
||||
public $accounts;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
AuthChoiceAsset::register(Yii::$app->view);
|
||||
if ($this->popupMode) {
|
||||
Yii::$app->view->registerJs("\$('#" . $this->getId() . "').authchoice();");
|
||||
}
|
||||
$this->options['id'] = $this->getId();
|
||||
echo Html::beginTag('div', $this->options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function createClientUrl($provider)
|
||||
{
|
||||
if ($this->isConnected($provider)) {
|
||||
return Url::to(['/user/settings/disconnect', 'id' => $this->accounts[$provider->getId()]->id]);
|
||||
} else {
|
||||
return parent::createClientUrl($provider);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if provider already connected to user.
|
||||
*
|
||||
* @param ClientInterface $provider
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isConnected(ClientInterface $provider)
|
||||
{
|
||||
return $this->accounts != null && isset($this->accounts[$provider->getId()]);
|
||||
}
|
||||
}
|
||||
21
lib/User/Widget/LoginWidget.php
Normal file
21
lib/User/Widget/LoginWidget.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace Da\User\Widget;
|
||||
|
||||
use Da\User\Form\LoginForm;
|
||||
use Yii;
|
||||
use yii\base\Widget;
|
||||
|
||||
class LoginWidget extends Widget
|
||||
{
|
||||
public $validate = true;
|
||||
|
||||
public function run()
|
||||
{
|
||||
return $this->render(
|
||||
'login',
|
||||
[
|
||||
'model' => Yii::createObject(LoginForm::class)
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,19 +1,10 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/**
|
||||
* @var dektrium\user\models\User $user
|
||||
* @var dektrium\user\models\Token $token
|
||||
* @var \Da\User\Model\User $user
|
||||
* @var \Da\User\Model\Token $token
|
||||
*/
|
||||
?>
|
||||
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;">
|
||||
|
||||
@ -1,14 +1,4 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var \yii\web\View $this
|
||||
* @var yii\mail\BaseMessage $content
|
||||
|
||||
@ -1,14 +1,4 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var string $content main view render result
|
||||
*/
|
||||
|
||||
@ -1,18 +1,8 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/**
|
||||
* @var dektrium\user\models\Token $token
|
||||
* @var \Da\User\Model\Token $token
|
||||
*/
|
||||
?>
|
||||
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;">
|
||||
|
||||
@ -1,19 +1,10 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/**
|
||||
* @var dektrium\user\models\User $user
|
||||
* @var dektrium\user\models\Token $token
|
||||
* @var \Da\User\Model\User $user
|
||||
* @var \Da\User\Model\Token $token
|
||||
*/
|
||||
?>
|
||||
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;">
|
||||
|
||||
@ -1,17 +1,8 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var dektrium\user\models\User $user
|
||||
* @var dektrium\user\models\Token $token
|
||||
* @var \Da\User\Model\User $user
|
||||
* @var \Da\User\Model\Token $token
|
||||
*/
|
||||
?>
|
||||
<?= Yii::t('user', 'Hello') ?>,
|
||||
|
||||
@ -1,16 +1,6 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var dektrium\user\models\Token $token
|
||||
* @var \Da\User\Model\Token $token
|
||||
*/
|
||||
?>
|
||||
<?= Yii::t('user', 'Hello') ?>,
|
||||
|
||||
@ -1,17 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var dektrium\user\models\User $user
|
||||
* @var dektrium\user\models\Token $token
|
||||
* @var \Da\User\Model\User $user
|
||||
* @var \Da\User\Model\Token $token
|
||||
*/
|
||||
?>
|
||||
<?= Yii::t('user', 'Hello') ?>,
|
||||
|
||||
@ -1,32 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var dektrium\user\models\User
|
||||
* @var \Da\User\Model\User $user
|
||||
* @var \Da\User\Model\Token $token
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
?>
|
||||
<?= Yii::t('user', 'Hello') ?>,
|
||||
|
||||
<?= Yii::t('user', 'Your account on {0} has been created', Yii::$app->name) ?>.
|
||||
<?php if ($module->enableGeneratingPassword): ?>
|
||||
<?= Yii::t('user', 'We have generated a password for you') ?>:
|
||||
<?= $user->password ?>
|
||||
<?php if ($module->generatePasswords): ?>
|
||||
<?= Yii::t('user', 'We have generated a password for you') ?>:
|
||||
<?= $user->password ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($token !== null): ?>
|
||||
<?= Yii::t('user', 'In order to complete your registration, please click the link below') ?>.
|
||||
|
||||
<?= $token->url ?>
|
||||
|
||||
<?= Yii::t('user', 'If you cannot click the link, please try pasting the text into your browser') ?>.
|
||||
<?= Yii::t('user', 'In order to complete your registration, please click the link below') ?>.
|
||||
<?= $token->url ?>
|
||||
<?= Yii::t('user', 'If you cannot click the link, please try pasting the text into your browser') ?>.
|
||||
<?php endif ?>
|
||||
|
||||
<?= Yii::t('user', 'If you did not make this request you can ignore this email') ?>.
|
||||
|
||||
@ -1,20 +1,10 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/**
|
||||
* @var dektrium\user\Module $module
|
||||
* @var dektrium\user\models\User $user
|
||||
* @var dektrium\user\models\Token $token
|
||||
* @var \Da\User\Module $module
|
||||
* @var \Da\User\Model\User $user
|
||||
* @var \Da\User\Model\Token $token
|
||||
* @var bool $showPassword
|
||||
*/
|
||||
|
||||
@ -25,22 +15,22 @@ use yii\helpers\Html;
|
||||
|
||||
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;">
|
||||
<?= Yii::t('user', 'Your account on {0} has been created', Yii::$app->name) ?>.
|
||||
<?php if ($showPassword || $module->enableGeneratingPassword): ?>
|
||||
<?php if ($showPassword || $module->generatePasswords): ?>
|
||||
<?= Yii::t('user', 'We have generated a password for you') ?>: <strong><?= $user->password ?></strong>
|
||||
<?php endif ?>
|
||||
|
||||
</p>
|
||||
|
||||
<?php if ($token !== null): ?>
|
||||
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;">
|
||||
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;">
|
||||
<?= Yii::t('user', 'In order to complete your registration, please click the link below') ?>.
|
||||
</p>
|
||||
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;">
|
||||
</p>
|
||||
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;">
|
||||
<?= Html::a(Html::encode($token->url), $token->url); ?>
|
||||
</p>
|
||||
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;">
|
||||
</p>
|
||||
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;">
|
||||
<?= Yii::t('user', 'If you cannot click the link, please try pasting the text into your browser') ?>.
|
||||
</p>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
|
||||
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;">
|
||||
|
||||
@ -1,19 +1,10 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/**
|
||||
* @var \yii\web\View $this
|
||||
* @var \dektrium\user\models\Profile $profile
|
||||
* @var \Da\User\Model\Profile $profile
|
||||
*/
|
||||
|
||||
$this->title = empty($profile->name) ? Html::encode($profile->user->username) : Html::encode($profile->name);
|
||||
@ -32,15 +23,29 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<h4><?= $this->title ?></h4>
|
||||
<ul style="padding: 0; list-style: none outside none;">
|
||||
<?php if (!empty($profile->location)): ?>
|
||||
<li><i class="glyphicon glyphicon-map-marker text-muted"></i> <?= Html::encode($profile->location) ?></li>
|
||||
<li>
|
||||
<i class="glyphicon glyphicon-map-marker text-muted"></i>
|
||||
<?= Html::encode($profile->location) ?>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($profile->website)): ?>
|
||||
<li><i class="glyphicon glyphicon-globe text-muted"></i> <?= Html::a(Html::encode($profile->website), Html::encode($profile->website)) ?></li>
|
||||
<li>
|
||||
<i class="glyphicon glyphicon-globe text-muted"></i>
|
||||
<?= Html::a(Html::encode($profile->website), Html::encode($profile->website)) ?>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($profile->public_email)): ?>
|
||||
<li><i class="glyphicon glyphicon-envelope text-muted"></i> <?= Html::a(Html::encode($profile->public_email), 'mailto:' . Html::encode($profile->public_email)) ?></li>
|
||||
<li>
|
||||
<i class="glyphicon glyphicon-envelope text-muted"></i>
|
||||
<?= Html::a(Html::encode($profile->public_email), 'mailto:' .
|
||||
Html::encode($profile->public_email))
|
||||
?>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<li><i class="glyphicon glyphicon-time text-muted"></i> <?= Yii::t('user', 'Joined on {0, date}', $profile->user->created_at) ?></li>
|
||||
<li>
|
||||
<i class="glyphicon glyphicon-time text-muted"></i>
|
||||
<?= Yii::t('user', 'Joined on {0, date}', $profile->user->created_at) ?>
|
||||
</li>
|
||||
</ul>
|
||||
<?php if (!empty($profile->bio)): ?>
|
||||
<p><?= Html::encode($profile->bio) ?></p>
|
||||
|
||||
@ -1,21 +1,11 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @var yii\web\View $this
|
||||
* @var yii\widgets\ActiveForm $form
|
||||
* @var dektrium\user\models\RecoveryForm $model
|
||||
* @var \Da\User\Form\RecoveryForm $model
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Recover your password');
|
||||
@ -28,11 +18,13 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'password-recovery-form',
|
||||
<?php $form = ActiveForm::begin(
|
||||
[
|
||||
'id' => $model->formName(),
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
]); ?>
|
||||
]
|
||||
); ?>
|
||||
|
||||
<?= $form->field($model, 'email')->textInput(['autofocus' => true]) ?>
|
||||
|
||||
|
||||
@ -1,21 +1,12 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @var yii\web\View $this
|
||||
* @var yii\widgets\ActiveForm $form
|
||||
* @var dektrium\user\models\RecoveryForm $model
|
||||
* @var \Da\User\Form\RecoveryForm $model
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Reset your password');
|
||||
@ -28,11 +19,13 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'password-recovery-form',
|
||||
<?php $form = ActiveForm::begin(
|
||||
[
|
||||
'id' => $model->formName(),
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
]); ?>
|
||||
]
|
||||
); ?>
|
||||
|
||||
<?= $form->field($model, 'password')->passwordInput() ?>
|
||||
|
||||
|
||||
@ -1,22 +1,12 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/**
|
||||
* @var yii\web\View $this
|
||||
* @var yii\widgets\ActiveForm $form
|
||||
* @var dektrium\user\models\User $model
|
||||
* @var dektrium\user\models\Account $account
|
||||
* @var \Da\User\Model\User $model
|
||||
* @var \Da\User\Model\SocialNetworkAccount $account
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Sign in');
|
||||
@ -37,9 +27,11 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
) ?>:
|
||||
</p>
|
||||
</div>
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'connect-account-form',
|
||||
]); ?>
|
||||
<?php $form = ActiveForm::begin(
|
||||
[
|
||||
'id' => $model->formName(),
|
||||
]
|
||||
); ?>
|
||||
|
||||
<?= $form->field($model, 'email') ?>
|
||||
|
||||
|
||||
@ -14,8 +14,9 @@ use yii\widgets\ActiveForm;
|
||||
|
||||
/**
|
||||
* @var yii\web\View $this
|
||||
* @var dektrium\user\models\User $user
|
||||
* @var dektrium\user\Module $module
|
||||
* @var \Da\User\Form\RegistrationForm $model
|
||||
* @var \Da\User\Model\User $user
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Sign up');
|
||||
@ -28,17 +29,19 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'registration-form',
|
||||
<?php $form = ActiveForm::begin(
|
||||
[
|
||||
'id' => $model->formName(),
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
]); ?>
|
||||
]
|
||||
); ?>
|
||||
|
||||
<?= $form->field($model, 'email') ?>
|
||||
|
||||
<?= $form->field($model, 'username') ?>
|
||||
|
||||
<?php if ($module->enableGeneratingPassword == false): ?>
|
||||
<?php if ($module->generatePasswords == false): ?>
|
||||
<?= $form->field($model, 'password')->passwordInput() ?>
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
@ -1,20 +1,10 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @var yii\web\View $this
|
||||
* @var dektrium\user\models\ResendForm $model
|
||||
* @var \Da\User\Form\ResendForm $model
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Request new confirmation message');
|
||||
@ -27,11 +17,13 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'resend-form',
|
||||
<?php $form = ActiveForm::begin(
|
||||
[
|
||||
'id' => $model->formName(),
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
]); ?>
|
||||
]
|
||||
); ?>
|
||||
|
||||
<?= $form->field($model, 'email')->textInput(['autofocus' => true]) ?>
|
||||
|
||||
|
||||
@ -1,22 +1,13 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use dektrium\user\widgets\Connect;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/**
|
||||
* @var yii\web\View $this
|
||||
* @var dektrium\user\models\LoginForm $model
|
||||
* @var dektrium\user\Module $module
|
||||
* @var \Da\User\Form\LoginForm $model
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Sign in');
|
||||
@ -32,14 +23,16 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'login-form',
|
||||
<?php $form = ActiveForm::begin(
|
||||
[
|
||||
'id' => $model->formName(),
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
'validateOnBlur' => false,
|
||||
'validateOnType' => false,
|
||||
'validateOnChange' => false,
|
||||
]) ?>
|
||||
]
|
||||
) ?>
|
||||
|
||||
<?= $form->field(
|
||||
$model,
|
||||
@ -56,7 +49,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
->passwordInput()
|
||||
->label(
|
||||
Yii::t('user', 'Password')
|
||||
.($module->enablePasswordRecovery ?
|
||||
. ($module->allowPasswordRecovery ?
|
||||
' (' . Html::a(
|
||||
Yii::t('user', 'Forgot password?'),
|
||||
['/user/recovery/request'],
|
||||
@ -75,7 +68,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module->enableConfirmation): ?>
|
||||
<?php if ($module->enableEmailConfirmation): ?>
|
||||
<p class="text-center">
|
||||
<?= Html::a(Yii::t('user', 'Didn\'t receive confirmation message?'), ['/user/registration/resend']) ?>
|
||||
</p>
|
||||
@ -85,8 +78,10 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<?= Html::a(Yii::t('user', 'Don\'t have an account? Sign up!'), ['/user/registration/register']) ?>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
<?= Connect::widget([
|
||||
<?= Connect::widget(
|
||||
[
|
||||
'baseAuthUrl' => ['/user/security/auth'],
|
||||
]) ?>
|
||||
]
|
||||
) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,18 +1,9 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\Menu;
|
||||
|
||||
/** @var dektrium\user\models\User $user */
|
||||
/** @var \Da\User\Model\User $user */
|
||||
$user = Yii::$app->user->identity;
|
||||
$networksVisible = count(Yii::$app->authClientCollection->clients) > 0;
|
||||
|
||||
@ -21,15 +12,19 @@ $networksVisible = count(Yii::$app->authClientCollection->clients) > 0;
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">
|
||||
<?= Html::img($user->profile->getAvatarUrl(24), [
|
||||
<?= Html::img(
|
||||
$user->profile->getAvatarUrl(24),
|
||||
[
|
||||
'class' => 'img-rounded',
|
||||
'alt' => $user->username,
|
||||
]) ?>
|
||||
]
|
||||
) ?>
|
||||
<?= $user->username ?>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?= Menu::widget([
|
||||
<?= Menu::widget(
|
||||
[
|
||||
'options' => [
|
||||
'class' => 'nav nav-pills nav-stacked',
|
||||
],
|
||||
@ -42,6 +37,7 @@ $networksVisible = count(Yii::$app->authClientCollection->clients) > 0;
|
||||
'visible' => $networksVisible
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
]
|
||||
) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,21 +1,12 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/**
|
||||
* @var $this yii\web\View
|
||||
* @var $form yii\widgets\ActiveForm
|
||||
* @var $model dektrium\user\models\SettingsForm
|
||||
* @var yii\web\View $this
|
||||
* @var yii\widgets\ActiveForm $form
|
||||
* @var \Da\User\Form\SettingsForm $model
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Account settings');
|
||||
@ -35,7 +26,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'account-form',
|
||||
'id' => $model->formName(),
|
||||
'options' => ['class' => 'form-horizontal'],
|
||||
'fieldConfig' => [
|
||||
'template' => "{label}\n<div class=\"col-lg-9\">{input}</div>\n<div class=\"col-sm-offset-3 col-lg-9\">{error}\n{hint}</div>",
|
||||
@ -65,7 +56,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($model->module->enableAccountDelete): ?>
|
||||
<?php if ($model->module->allowAccountDelete): ?>
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?= Yii::t('user', 'Delete account') ?></h3>
|
||||
|
||||
@ -1,20 +1,12 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Dektrium project.
|
||||
*
|
||||
* (c) Dektrium project <http://github.com/dektrium>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use dektrium\user\widgets\Connect;
|
||||
use Da\User\Widget\ConnectWidget;
|
||||
use yii\helpers\Html;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @var yii\web\View $this
|
||||
* @var yii\widgets\ActiveForm $form
|
||||
* @var \Da\User\Model\User $user
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Networks');
|
||||
@ -36,9 +28,9 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<div class="alert alert-info">
|
||||
<p><?= Yii::t('user', 'You can connect multiple accounts to be able to log in using them') ?>.</p>
|
||||
</div>
|
||||
<?php $auth = Connect::begin([
|
||||
<?php $auth = ConnectWidget::begin([
|
||||
'baseAuthUrl' => ['/user/security/auth'],
|
||||
'accounts' => $user->accounts,
|
||||
'accounts' => $user->socialNetworkAccounts,
|
||||
'autoRender' => false,
|
||||
'popupMode' => false,
|
||||
]) ?>
|
||||
@ -65,7 +57,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php Connect::end() ?>
|
||||
<?php ConnectWidget::end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user