added views and Authclients
This commit is contained in:
25
lib/User/AuthClient/Facebook.php
Normal file
25
lib/User/AuthClient/Facebook.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace Da\User\AuthClient;
|
||||
|
||||
use Da\User\Contracts\AuthClientInterface;
|
||||
|
||||
class Facebook extends \yii\authclient\clients\Facebook implements AuthClientInterface
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return isset($this->getUserAttributes()['email'])
|
||||
? $this->getUserAttributes()['email']
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
27
lib/User/AuthClient/GitHub.php
Normal file
27
lib/User/AuthClient/GitHub.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace Da\User\AuthClient;
|
||||
|
||||
use Da\User\Contracts\AuthClientInterface;
|
||||
|
||||
class GitHub extends \yii\authclient\clients\GitHub implements AuthClientInterface
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return isset($this->getUserAttributes()['email'])
|
||||
? $this->getUserAttributes()['email']
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return isset($this->getUserAttributes()['login'])
|
||||
? $this->getUserAttributes()['login']
|
||||
: null;
|
||||
}
|
||||
}
|
||||
25
lib/User/AuthClient/Google.php
Normal file
25
lib/User/AuthClient/Google.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace Da\User\AuthClient;
|
||||
|
||||
use Da\User\Contracts\AuthClientInterface;
|
||||
|
||||
class Google extends \yii\authclient\clients\Google implements AuthClientInterface
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return isset($this->getUserAttributes()['emails'][0]['value'])
|
||||
? $this->getUserAttributes()['emails'][0]['value']
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
25
lib/User/AuthClient/LinkedIn.php
Normal file
25
lib/User/AuthClient/LinkedIn.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace Da\User\AuthClient;
|
||||
|
||||
use Da\User\Contracts\AuthClientInterface;
|
||||
|
||||
class LinkedIn extends \yii\authclient\clients\LinkedIn implements AuthClientInterface
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return isset($this->getUserAttributes()['email-address'])
|
||||
? $this->getUserAttributes()['email-address']
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
26
lib/User/AuthClient/Twitter.php
Normal file
26
lib/User/AuthClient/Twitter.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace Da\User\AuthClient;
|
||||
|
||||
use Da\User\Contracts\AuthClientInterface;
|
||||
|
||||
|
||||
class Twitter extends \dektrium\user\clients\Twitter implements AuthClientInterface
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return isset($this->getUserAttributes()['screen_name'])
|
||||
? $this->getUserAttributes()['screen_name']
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null Twitter does not provide user's email address
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
39
lib/User/AuthClient/VKontakte.php
Normal file
39
lib/User/AuthClient/VKontakte.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
namespace Da\User\AuthClient;
|
||||
|
||||
use Da\User\Contracts\AuthClientInterface;
|
||||
use Yii;
|
||||
|
||||
class VKontakte extends \yii\authclient\clients\VKontakte implements AuthClientInterface
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $scope = 'email';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->getAccessToken()->getParam('email');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return isset($this->getUserAttributes()['screen_name'])
|
||||
? $this->getUserAttributes()['screen_name']
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
protected function defaultTitle()
|
||||
{
|
||||
return Yii::t('user', 'VKontakte');
|
||||
}
|
||||
}
|
||||
42
lib/User/AuthClient/Yandex.php
Normal file
42
lib/User/AuthClient/Yandex.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
namespace Da\User\AuthClient;
|
||||
|
||||
use Da\User\Contracts\AuthClientInterface;
|
||||
use Yii;
|
||||
|
||||
class Yandex extends \yii\authclient\clients\Yandex implements AuthClientInterface
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
$emails = isset($this->getUserAttributes()['emails'])
|
||||
? $this->getUserAttributes()['emails']
|
||||
: null;
|
||||
|
||||
if ($emails !== null && isset($emails[0])) {
|
||||
return $emails[0];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return isset($this->getUserAttributes()['login'])
|
||||
? $this->getUserAttributes()['login']
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
protected function defaultTitle()
|
||||
{
|
||||
return Yii::t('user', 'Yandex');
|
||||
}
|
||||
}
|
||||
@ -90,7 +90,7 @@ class RecoveryController extends Controller
|
||||
$this->trigger(FormEvent::EVENT_AFTER_REQUEST, $event);
|
||||
|
||||
return $this->render(
|
||||
'message',
|
||||
'/user/shared/message',
|
||||
[
|
||||
'title' => Yii::t('user', 'Recovery message sent'),
|
||||
'module' => $this->module,
|
||||
@ -130,7 +130,7 @@ class RecoveryController extends Controller
|
||||
);
|
||||
|
||||
return $this->render(
|
||||
'message',
|
||||
'/user/shared/message',
|
||||
[
|
||||
'title' => Yii::t('user', 'Invalid or expired link'),
|
||||
'module' => $this->module,
|
||||
@ -149,7 +149,7 @@ class RecoveryController extends Controller
|
||||
$this->trigger(ResetPasswordEvent::EVENT_AFTER_RESET, $event);
|
||||
|
||||
return $this->render(
|
||||
'message',
|
||||
'/user/shared/message',
|
||||
[
|
||||
'title' => Yii::t('user', 'Password has been changed'),
|
||||
'module' => $this->module,
|
||||
|
||||
@ -106,7 +106,7 @@ class RegistrationController extends Controller
|
||||
'Your account has been created and a message with further instructions has been sent to your email'
|
||||
)
|
||||
);
|
||||
return $this->render('message', [
|
||||
return $this->render('/user/shared/message', [
|
||||
'title' => Yii::t('user', 'Your account has been created')
|
||||
]);
|
||||
}
|
||||
@ -186,7 +186,7 @@ class RegistrationController extends Controller
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'message',
|
||||
'/user/shared/message',
|
||||
[
|
||||
'title' => Yii::t('user', 'Account confirmation'),
|
||||
'module' => $this->module,
|
||||
|
||||
45
lib/User/resources/views/admin/_account.php
Normal file
45
lib/User/resources/views/admin/_account.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?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\bootstrap\ActiveForm;
|
||||
use yii\helpers\Html;
|
||||
|
||||
/*
|
||||
* @var yii\web\View $this
|
||||
* @var dektrium\user\models\User $user
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@dektrium/user/views/admin/update.php', ['user' => $user]) ?>
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'layout' => 'horizontal',
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
'fieldConfig' => [
|
||||
'horizontalCssClasses' => [
|
||||
'wrapper' => 'col-sm-9',
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
<?= $this->render('_user', ['form' => $form, 'user' => $user]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-3 col-lg-9">
|
||||
<?= Html::submitButton(Yii::t('user', 'Update'), ['class' => 'btn btn-block btn-success']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
<?php $this->endContent() ?>
|
||||
32
lib/User/resources/views/admin/_assignments.php
Normal file
32
lib/User/resources/views/admin/_assignments.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?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\rbac\widgets\Assignments;
|
||||
|
||||
/**
|
||||
* @var yii\web\View $this
|
||||
* @var dektrium\user\models\User $user
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@dektrium/user/views/admin/update.php', ['user' => $user]) ?>
|
||||
|
||||
<?= yii\bootstrap\Alert::widget([
|
||||
'options' => [
|
||||
'class' => 'alert-info alert-dismissible',
|
||||
],
|
||||
'body' => Yii::t('user', 'You can assign multiple roles or permissions to user by using the form below'),
|
||||
]) ?>
|
||||
|
||||
<?= Assignments::widget(['userId' => $user->id]) ?>
|
||||
|
||||
<?php $this->endContent() ?>
|
||||
58
lib/User/resources/views/admin/_info.php
Normal file
58
lib/User/resources/views/admin/_info.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?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
|
||||
* @var dektrium\user\models\User
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@dektrium/user/views/admin/update.php', ['user' => $user]) ?>
|
||||
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td><strong><?= Yii::t('user', 'Registration time') ?>:</strong></td>
|
||||
<td><?= Yii::t('user', '{0, date, MMMM dd, YYYY HH:mm}', [$user->created_at]) ?></td>
|
||||
</tr>
|
||||
<?php if ($user->registration_ip !== null): ?>
|
||||
<tr>
|
||||
<td><strong><?= Yii::t('user', 'Registration IP') ?>:</strong></td>
|
||||
<td><?= $user->registration_ip ?></td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
<tr>
|
||||
<td><strong><?= Yii::t('user', 'Confirmation status') ?>:</strong></td>
|
||||
<?php if ($user->isConfirmed): ?>
|
||||
<td class="text-success"><?= Yii::t(
|
||||
'user',
|
||||
'Confirmed at {0, date, MMMM dd, YYYY HH:mm}',
|
||||
[$user->confirmed_at]
|
||||
) ?></td>
|
||||
<?php else: ?>
|
||||
<td class="text-danger"><?= Yii::t('user', 'Unconfirmed') ?></td>
|
||||
<?php endif ?>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?= Yii::t('user', 'Block status') ?>:</strong></td>
|
||||
<?php if ($user->isBlocked): ?>
|
||||
<td class="text-danger"><?= Yii::t(
|
||||
'user',
|
||||
'Blocked at {0, date, MMMM dd, YYYY HH:mm}',
|
||||
[$user->blocked_at]
|
||||
) ?>
|
||||
</td>
|
||||
<?php else: ?>
|
||||
<td class="text-success"><?= Yii::t('user', 'Not blocked') ?></td>
|
||||
<?php endif ?>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php $this->endContent() ?>
|
||||
56
lib/User/resources/views/admin/_menu.php
Normal file
56
lib/User/resources/views/admin/_menu.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?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\bootstrap\Nav;
|
||||
|
||||
?>
|
||||
|
||||
<?= Nav::widget([
|
||||
'options' => [
|
||||
'class' => 'nav-tabs',
|
||||
'style' => 'margin-bottom: 15px',
|
||||
],
|
||||
'items' => [
|
||||
[
|
||||
'label' => Yii::t('user', 'Users'),
|
||||
'url' => ['/user/admin/index'],
|
||||
],
|
||||
[
|
||||
'label' => Yii::t('user', 'Roles'),
|
||||
'url' => ['/rbac/role/index'],
|
||||
'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']),
|
||||
],
|
||||
[
|
||||
'label' => Yii::t('user', 'Permissions'),
|
||||
'url' => ['/rbac/permission/index'],
|
||||
'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']),
|
||||
],
|
||||
[
|
||||
'label' => Yii::t('user', 'Create'),
|
||||
'items' => [
|
||||
[
|
||||
'label' => Yii::t('user', 'New user'),
|
||||
'url' => ['/user/admin/create'],
|
||||
],
|
||||
[
|
||||
'label' => Yii::t('user', 'New role'),
|
||||
'url' => ['/rbac/role/create'],
|
||||
'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']),
|
||||
],
|
||||
[
|
||||
'label' => Yii::t('user', 'New permission'),
|
||||
'url' => ['/rbac/permission/create'],
|
||||
'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']),
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
52
lib/User/resources/views/admin/_profile.php
Normal file
52
lib/User/resources/views/admin/_profile.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?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\bootstrap\ActiveForm;
|
||||
use yii\helpers\Html;
|
||||
|
||||
/**
|
||||
* @var yii\web\View $this
|
||||
* @var dektrium\user\models\User $user
|
||||
* @var dektrium\user\models\Profile $profile
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@dektrium/user/views/admin/update.php', ['user' => $user]) ?>
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'layout' => 'horizontal',
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
'fieldConfig' => [
|
||||
'horizontalCssClasses' => [
|
||||
'wrapper' => 'col-sm-9',
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($profile, 'name') ?>
|
||||
<?= $form->field($profile, 'public_email') ?>
|
||||
<?= $form->field($profile, 'website') ?>
|
||||
<?= $form->field($profile, 'location') ?>
|
||||
<?= $form->field($profile, 'gravatar_email') ?>
|
||||
<?= $form->field($profile, 'bio')->textarea() ?>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-3 col-lg-9">
|
||||
<?= Html::submitButton(Yii::t('user', 'Update'), ['class' => 'btn btn-block btn-success']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
<?php $this->endContent() ?>
|
||||
20
lib/User/resources/views/admin/_user.php
Normal file
20
lib/User/resources/views/admin/_user.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?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\widgets\ActiveForm $form
|
||||
* @var dektrium\user\models\User $user
|
||||
*/
|
||||
?>
|
||||
|
||||
<?= $form->field($user, 'email')->textInput(['maxlength' => 255]) ?>
|
||||
<?= $form->field($user, 'username')->textInput(['maxlength' => 255]) ?>
|
||||
<?= $form->field($user, 'password')->passwordInput() ?>
|
||||
86
lib/User/resources/views/admin/create.php
Normal file
86
lib/User/resources/views/admin/create.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?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\bootstrap\ActiveForm;
|
||||
use yii\bootstrap\Nav;
|
||||
use yii\helpers\Html;
|
||||
|
||||
/**
|
||||
* @var yii\web\View $this
|
||||
* @var dektrium\user\models\User $user
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Create a user account');
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('user', 'Users'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?= $this->render('/_alert', [
|
||||
'module' => Yii::$app->getModule('user'),
|
||||
]) ?>
|
||||
|
||||
<?= $this->render('_menu') ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<?= Nav::widget([
|
||||
'options' => [
|
||||
'class' => 'nav-pills nav-stacked',
|
||||
],
|
||||
'items' => [
|
||||
['label' => Yii::t('user', 'Account details'), 'url' => ['/user/admin/create']],
|
||||
['label' => Yii::t('user', 'Profile details'), 'options' => [
|
||||
'class' => 'disabled',
|
||||
'onclick' => 'return false;',
|
||||
]],
|
||||
['label' => Yii::t('user', 'Information'), 'options' => [
|
||||
'class' => 'disabled',
|
||||
'onclick' => 'return false;',
|
||||
]],
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-info">
|
||||
<?= Yii::t('user', 'Credentials will be sent to the user by email') ?>.
|
||||
<?= Yii::t('user', 'A password will be generated automatically if not provided') ?>.
|
||||
</div>
|
||||
<?php $form = ActiveForm::begin([
|
||||
'layout' => 'horizontal',
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
'fieldConfig' => [
|
||||
'horizontalCssClasses' => [
|
||||
'wrapper' => 'col-sm-9',
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
<?= $this->render('_user', ['form' => $form, 'user' => $user]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-3 col-lg-9">
|
||||
<?= Html::submitButton(Yii::t('user', 'Save'), ['class' => 'btn btn-block btn-success']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
107
lib/User/resources/views/admin/index.php
Normal file
107
lib/User/resources/views/admin/index.php
Normal file
@ -0,0 +1,107 @@
|
||||
<?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\models\UserSearch;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\Html;
|
||||
use yii\web\View;
|
||||
use yii\widgets\Pjax;
|
||||
|
||||
/**
|
||||
* @var View $this
|
||||
* @var ActiveDataProvider $dataProvider
|
||||
* @var UserSearch $searchModel
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Manage users');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<?= $this->render('/_alert', [
|
||||
'module' => Yii::$app->getModule('user'),
|
||||
]) ?>
|
||||
|
||||
<?= $this->render('/admin/_menu') ?>
|
||||
|
||||
<?php Pjax::begin() ?>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'layout' => "{items}\n{pager}",
|
||||
'columns' => [
|
||||
'username',
|
||||
'email:email',
|
||||
[
|
||||
'attribute' => 'registration_ip',
|
||||
'value' => function ($model) {
|
||||
return $model->registration_ip == null
|
||||
? '<span class="not-set">' . Yii::t('user', '(not set)') . '</span>'
|
||||
: $model->registration_ip;
|
||||
},
|
||||
'format' => 'html',
|
||||
],
|
||||
[
|
||||
'attribute' => 'created_at',
|
||||
'value' => function ($model) {
|
||||
if (extension_loaded('intl')) {
|
||||
return Yii::t('user', '{0, date, MMMM dd, YYYY HH:mm}', [$model->created_at]);
|
||||
} else {
|
||||
return date('Y-m-d G:i:s', $model->created_at);
|
||||
}
|
||||
},
|
||||
],
|
||||
[
|
||||
'header' => Yii::t('user', 'Confirmation'),
|
||||
'value' => function ($model) {
|
||||
if ($model->isConfirmed) {
|
||||
return '<div class="text-center">
|
||||
<span class="text-success">' . Yii::t('user', 'Confirmed') . '</span>
|
||||
</div>';
|
||||
} else {
|
||||
return Html::a(Yii::t('user', 'Confirm'), ['confirm', 'id' => $model->id], [
|
||||
'class' => 'btn btn-xs btn-success btn-block',
|
||||
'data-method' => 'post',
|
||||
'data-confirm' => Yii::t('user', 'Are you sure you want to confirm this user?'),
|
||||
]);
|
||||
}
|
||||
},
|
||||
'format' => 'raw',
|
||||
'visible' => Yii::$app->getModule('user')->enableConfirmation,
|
||||
],
|
||||
[
|
||||
'header' => Yii::t('user', 'Block status'),
|
||||
'value' => function ($model) {
|
||||
if ($model->isBlocked) {
|
||||
return Html::a(Yii::t('user', 'Unblock'), ['block', 'id' => $model->id], [
|
||||
'class' => 'btn btn-xs btn-success btn-block',
|
||||
'data-method' => 'post',
|
||||
'data-confirm' => Yii::t('user', 'Are you sure you want to unblock this user?'),
|
||||
]);
|
||||
} else {
|
||||
return Html::a(Yii::t('user', 'Block'), ['block', 'id' => $model->id], [
|
||||
'class' => 'btn btn-xs btn-danger btn-block',
|
||||
'data-method' => 'post',
|
||||
'data-confirm' => Yii::t('user', 'Are you sure you want to block this user?'),
|
||||
]);
|
||||
}
|
||||
},
|
||||
'format' => 'raw',
|
||||
],
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{update} {delete}',
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
<?php Pjax::end() ?>
|
||||
109
lib/User/resources/views/admin/update.php
Normal file
109
lib/User/resources/views/admin/update.php
Normal file
@ -0,0 +1,109 @@
|
||||
<?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\models\User;
|
||||
use yii\bootstrap\Nav;
|
||||
use yii\web\View;
|
||||
|
||||
/**
|
||||
* @var View $this
|
||||
* @var User $user
|
||||
* @var string $content
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Update user account');
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('user', 'Users'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?= $this->render('/_alert', [
|
||||
'module' => Yii::$app->getModule('user'),
|
||||
]) ?>
|
||||
|
||||
<?= $this->render('_menu') ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<?= Nav::widget([
|
||||
'options' => [
|
||||
'class' => 'nav-pills nav-stacked',
|
||||
],
|
||||
'items' => [
|
||||
[
|
||||
'label' => Yii::t('user', 'Account details'),
|
||||
'url' => ['/user/admin/update', 'id' => $user->id]
|
||||
],
|
||||
[
|
||||
'label' => Yii::t('user', 'Profile details'),
|
||||
'url' => ['/user/admin/update-profile', 'id' => $user->id]
|
||||
],
|
||||
['label' => Yii::t('user', 'Information'), 'url' => ['/user/admin/info', 'id' => $user->id]],
|
||||
[
|
||||
'label' => Yii::t('user', 'Assignments'),
|
||||
'url' => ['/user/admin/assignments', 'id' => $user->id],
|
||||
'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']),
|
||||
],
|
||||
'<hr>',
|
||||
[
|
||||
'label' => Yii::t('user', 'Confirm'),
|
||||
'url' => ['/user/admin/confirm', 'id' => $user->id],
|
||||
'visible' => !$user->isConfirmed,
|
||||
'linkOptions' => [
|
||||
'class' => 'text-success',
|
||||
'data-method' => 'post',
|
||||
'data-confirm' => Yii::t('user', 'Are you sure you want to confirm this user?'),
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => Yii::t('user', 'Block'),
|
||||
'url' => ['/user/admin/block', 'id' => $user->id],
|
||||
'visible' => !$user->isBlocked,
|
||||
'linkOptions' => [
|
||||
'class' => 'text-danger',
|
||||
'data-method' => 'post',
|
||||
'data-confirm' => Yii::t('user', 'Are you sure you want to block this user?'),
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => Yii::t('user', 'Unblock'),
|
||||
'url' => ['/user/admin/block', 'id' => $user->id],
|
||||
'visible' => $user->isBlocked,
|
||||
'linkOptions' => [
|
||||
'class' => 'text-success',
|
||||
'data-method' => 'post',
|
||||
'data-confirm' => Yii::t('user', 'Are you sure you want to unblock this user?'),
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => Yii::t('user', 'Delete'),
|
||||
'url' => ['/user/admin/delete', 'id' => $user->id],
|
||||
'linkOptions' => [
|
||||
'class' => 'text-danger',
|
||||
'data-method' => 'post',
|
||||
'data-confirm' => Yii::t('user', 'Are you sure you want to delete this user?'),
|
||||
],
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<?= $content ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
34
lib/User/resources/views/mail/confirmation.php
Normal file
34
lib/User/resources/views/mail/confirmation.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?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
|
||||
*/
|
||||
?>
|
||||
<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', 'Hello') ?>,
|
||||
</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', 'Thank you for signing up on {0}', Yii::$app->name) ?>.
|
||||
<?= 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;">
|
||||
<?= 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;">
|
||||
<?= Yii::t('user', 'If you cannot click the link, please try pasting the text into your browser') ?>.
|
||||
</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 did not make this request you can ignore this email') ?>.
|
||||
</p>
|
||||
64
lib/User/resources/views/mail/layouts/html.php
Normal file
64
lib/User/resources/views/mail/layouts/html.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?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
|
||||
*/
|
||||
?>
|
||||
<?php $this->beginPage() ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<?php $this->head() ?>
|
||||
</head>
|
||||
<body bgcolor="#f6f6f6" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; margin: 0; padding: 0;">
|
||||
<table class="body-wrap" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; width: 100%; margin: 0; padding: 20px;">
|
||||
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
|
||||
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;"></td>
|
||||
<td class="container" bgcolor="#FFFFFF" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto; padding: 0; border: 1px solid #f0f0f0;">
|
||||
<div class="content" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; max-width: 600px; display: block; margin: 0 auto; padding: 20px;">
|
||||
<table style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; width: 100%; margin: 0; padding: 0;">
|
||||
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
|
||||
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
|
||||
<?php $this->beginBody() ?>
|
||||
<?= $content ?>
|
||||
<?php $this->endBody() ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="footer-wrap" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; width: 100%; clear: both !important; margin: 0; padding: 0;"><tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;"><td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;"></td>
|
||||
<td class="container" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto; padding: 0;">
|
||||
<div class="content" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; max-width: 600px; display: block; margin: 0 auto; padding: 20px;">
|
||||
<table style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; width: 100%; margin: 0; padding: 0;">
|
||||
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
|
||||
<td align="center" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
|
||||
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 1.6; color: #666; font-weight: normal; margin: 0 0 10px; padding: 0;">
|
||||
© <?= Yii::$app->name ?> <?= date('Y') ?>.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
<?php $this->endPage() ?>
|
||||
21
lib/User/resources/views/mail/layouts/text.php
Normal file
21
lib/User/resources/views/mail/layouts/text.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?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
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php $this->beginPage() ?>
|
||||
<?php $this->beginBody() ?>
|
||||
<?= $content ?>
|
||||
<?php $this->endBody() ?>
|
||||
<?php $this->endPage() ?>
|
||||
37
lib/User/resources/views/mail/reconfirmation.php
Normal file
37
lib/User/resources/views/mail/reconfirmation.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?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
|
||||
*/
|
||||
?>
|
||||
<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', 'Hello') ?>,
|
||||
</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',
|
||||
'We have received a request to change the email address for your account on {0}',
|
||||
Yii::$app->name
|
||||
) ?>.
|
||||
<?= Yii::t('user', 'In order to complete your request, 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;">
|
||||
<?= Html::a(Html::encode($token->getUrl()), $token->getUrl()); ?>
|
||||
</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 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 did not make this request you can ignore this email') ?>.
|
||||
</p>
|
||||
34
lib/User/resources/views/mail/recovery.php
Normal file
34
lib/User/resources/views/mail/recovery.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?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
|
||||
*/
|
||||
?>
|
||||
<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', 'Hello') ?>,
|
||||
</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', 'We have received a request to reset the password for your account on {0}', Yii::$app->name) ?>.
|
||||
<?= Yii::t('user', 'Please click the link below to complete your password reset') ?>.
|
||||
</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;">
|
||||
<?= Yii::t('user', 'If you cannot click the link, please try pasting the text into your browser') ?>.
|
||||
</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 did not make this request you can ignore this email') ?>.
|
||||
</p>
|
||||
26
lib/User/resources/views/mail/text/confirmation.php
Normal file
26
lib/User/resources/views/mail/text/confirmation.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?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
|
||||
*/
|
||||
?>
|
||||
<?= Yii::t('user', 'Hello') ?>,
|
||||
|
||||
<?= Yii::t('user', 'Thank you for signing up on {0}', Yii::$app->name) ?>.
|
||||
<?= 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', 'If you did not make this request you can ignore this email') ?>.
|
||||
29
lib/User/resources/views/mail/text/reconfirmation.php
Normal file
29
lib/User/resources/views/mail/text/reconfirmation.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?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
|
||||
*/
|
||||
?>
|
||||
<?= Yii::t('user', 'Hello') ?>,
|
||||
|
||||
<?= Yii::t(
|
||||
'user',
|
||||
'We have received a request to change the email address for your account on {0}',
|
||||
Yii::$app->name
|
||||
) ?>.
|
||||
<?= Yii::t('user', 'In order to complete your request, 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', 'If you did not make this request you can ignore this email') ?>.
|
||||
26
lib/User/resources/views/mail/text/recovery.php
Normal file
26
lib/User/resources/views/mail/text/recovery.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?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
|
||||
*/
|
||||
?>
|
||||
<?= Yii::t('user', 'Hello') ?>,
|
||||
|
||||
<?= Yii::t('user', 'We have received a request to reset the password for your account on {0}', Yii::$app->name) ?>.
|
||||
<?= Yii::t('user', 'Please click the link below to complete your password reset') ?>.
|
||||
|
||||
<?= $token->url ?>
|
||||
|
||||
<?= Yii::t('user', 'If you cannot click the link, please try pasting the text into your browser') ?>.
|
||||
|
||||
<?= Yii::t('user', 'If you did not make this request you can ignore this email') ?>.
|
||||
32
lib/User/resources/views/mail/text/welcome.php
Normal file
32
lib/User/resources/views/mail/text/welcome.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?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
|
||||
*/
|
||||
?>
|
||||
<?= 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 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') ?>.
|
||||
<?php endif ?>
|
||||
|
||||
<?= Yii::t('user', 'If you did not make this request you can ignore this email') ?>.
|
||||
48
lib/User/resources/views/mail/welcome.php
Normal file
48
lib/User/resources/views/mail/welcome.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?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 bool $showPassword
|
||||
*/
|
||||
|
||||
?>
|
||||
<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', 'Hello') ?>,
|
||||
</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', 'Your account on {0} has been created', Yii::$app->name) ?>.
|
||||
<?php if ($showPassword || $module->enableGeneratingPassword): ?>
|
||||
<?= 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;">
|
||||
<?= 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;">
|
||||
<?= 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;">
|
||||
<?= Yii::t('user', 'If you cannot click the link, please try pasting the text into your browser') ?>.
|
||||
</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;">
|
||||
<?= Yii::t('user', 'If you did not make this request you can ignore this email') ?>.
|
||||
</p>
|
||||
51
lib/User/resources/views/profile/show.php
Normal file
51
lib/User/resources/views/profile/show.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
$this->title = empty($profile->name) ? Html::encode($profile->user->username) : Html::encode($profile->name);
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6 col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-md-4">
|
||||
<?= Html::img($profile->getAvatarUrl(230), [
|
||||
'class' => 'img-rounded img-responsive',
|
||||
'alt' => $profile->user->username,
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-8">
|
||||
<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>
|
||||
<?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>
|
||||
<?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>
|
||||
<?php endif; ?>
|
||||
<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>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
45
lib/User/resources/views/recovery/request.php
Normal file
45
lib/User/resources/views/recovery/request.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Recover your password');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'password-recovery-form',
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'email')->textInput(['autofocus' => true]) ?>
|
||||
|
||||
<?= Html::submitButton(Yii::t('user', 'Continue'), ['class' => 'btn btn-primary btn-block']) ?><br>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
45
lib/User/resources/views/recovery/reset.php
Normal file
45
lib/User/resources/views/recovery/reset.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Reset your password');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'password-recovery-form',
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'password')->passwordInput() ?>
|
||||
|
||||
<?= Html::submitButton(Yii::t('user', 'Finish'), ['class' => 'btn btn-success btn-block']) ?><br>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
63
lib/User/resources/views/registration/connect.php
Normal file
63
lib/User/resources/views/registration/connect.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Sign in');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-info">
|
||||
<p>
|
||||
<?= Yii::t(
|
||||
'user',
|
||||
'In order to finish your registration, we need you to enter following fields'
|
||||
) ?>:
|
||||
</p>
|
||||
</div>
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'connect-account-form',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'email') ?>
|
||||
|
||||
<?= $form->field($model, 'username') ?>
|
||||
|
||||
<?= Html::submitButton(Yii::t('user', 'Continue'), ['class' => 'btn btn-success btn-block']) ?>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-center">
|
||||
<?= Html::a(
|
||||
Yii::t(
|
||||
'user',
|
||||
'If you already registered, sign in and connect this account on settings page'
|
||||
),
|
||||
['/user/settings/networks']
|
||||
) ?>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
54
lib/User/resources/views/registration/register.php
Normal file
54
lib/User/resources/views/registration/register.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?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\User $user
|
||||
* @var dektrium\user\Module $module
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Sign up');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'registration-form',
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'email') ?>
|
||||
|
||||
<?= $form->field($model, 'username') ?>
|
||||
|
||||
<?php if ($module->enableGeneratingPassword == false): ?>
|
||||
<?= $form->field($model, 'password')->passwordInput() ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?= Html::submitButton(Yii::t('user', 'Sign up'), ['class' => 'btn btn-success btn-block']) ?>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-center">
|
||||
<?= Html::a(Yii::t('user', 'Already registered? Sign in!'), ['/user/security/login']) ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
44
lib/User/resources/views/registration/resend.php
Normal file
44
lib/User/resources/views/registration/resend.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Request new confirmation message');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'resend-form',
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'email')->textInput(['autofocus' => true]) ?>
|
||||
|
||||
<?= Html::submitButton(Yii::t('user', 'Continue'), ['class' => 'btn btn-primary btn-block']) ?><br>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
92
lib/User/resources/views/security/login.php
Normal file
92
lib/User/resources/views/security/login.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Sign in');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<?= $this->render('/_alert', ['module' => Yii::$app->getModule('user')]) ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'login-form',
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
'validateOnBlur' => false,
|
||||
'validateOnType' => false,
|
||||
'validateOnChange' => false,
|
||||
]) ?>
|
||||
|
||||
<?= $form->field(
|
||||
$model,
|
||||
'login',
|
||||
['inputOptions' => ['autofocus' => 'autofocus', 'class' => 'form-control', 'tabindex' => '1']]
|
||||
) ?>
|
||||
|
||||
<?= $form
|
||||
->field(
|
||||
$model,
|
||||
'password',
|
||||
['inputOptions' => ['class' => 'form-control', 'tabindex' => '2']]
|
||||
)
|
||||
->passwordInput()
|
||||
->label(
|
||||
Yii::t('user', 'Password')
|
||||
.($module->enablePasswordRecovery ?
|
||||
' (' . Html::a(
|
||||
Yii::t('user', 'Forgot password?'),
|
||||
['/user/recovery/request'],
|
||||
['tabindex' => '5']
|
||||
)
|
||||
. ')' : '')
|
||||
) ?>
|
||||
|
||||
<?= $form->field($model, 'rememberMe')->checkbox(['tabindex' => '4']) ?>
|
||||
|
||||
<?= Html::submitButton(
|
||||
Yii::t('user', 'Sign in'),
|
||||
['class' => 'btn btn-primary btn-block', 'tabindex' => '3']
|
||||
) ?>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module->enableConfirmation): ?>
|
||||
<p class="text-center">
|
||||
<?= Html::a(Yii::t('user', 'Didn\'t receive confirmation message?'), ['/user/registration/resend']) ?>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
<?php if ($module->enableRegistration): ?>
|
||||
<p class="text-center">
|
||||
<?= Html::a(Yii::t('user', 'Don\'t have an account? Sign up!'), ['/user/registration/register']) ?>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
<?= Connect::widget([
|
||||
'baseAuthUrl' => ['/user/security/auth'],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
47
lib/User/resources/views/settings/_menu.php
Normal file
47
lib/User/resources/views/settings/_menu.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?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 */
|
||||
$user = Yii::$app->user->identity;
|
||||
$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), [
|
||||
'class' => 'img-rounded',
|
||||
'alt' => $user->username,
|
||||
]) ?>
|
||||
<?= $user->username ?>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?= Menu::widget([
|
||||
'options' => [
|
||||
'class' => 'nav nav-pills nav-stacked',
|
||||
],
|
||||
'items' => [
|
||||
['label' => Yii::t('user', 'Profile'), 'url' => ['/user/settings/profile']],
|
||||
['label' => Yii::t('user', 'Account'), 'url' => ['/user/settings/account']],
|
||||
[
|
||||
'label' => Yii::t('user', 'Networks'),
|
||||
'url' => ['/user/settings/networks'],
|
||||
'visible' => $networksVisible
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
88
lib/User/resources/views/settings/account.php
Normal file
88
lib/User/resources/views/settings/account.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Account settings');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<?= $this->render('/_alert', ['module' => Yii::$app->getModule('user')]) ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $this->render('_menu') ?>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => 'account-form',
|
||||
'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>",
|
||||
'labelOptions' => ['class' => 'col-lg-3 control-label'],
|
||||
],
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'email') ?>
|
||||
|
||||
<?= $form->field($model, 'username') ?>
|
||||
|
||||
<?= $form->field($model, 'new_password')->passwordInput() ?>
|
||||
|
||||
<hr />
|
||||
|
||||
<?= $form->field($model, 'current_password')->passwordInput() ?>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-3 col-lg-9">
|
||||
<?= Html::submitButton(Yii::t('user', 'Save'), ['class' => 'btn btn-block btn-success']) ?><br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($model->module->enableAccountDelete): ?>
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?= Yii::t('user', 'Delete account') ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>
|
||||
<?= Yii::t('user', 'Once you delete your account, there is no going back') ?>.
|
||||
<?= Yii::t('user', 'It will be deleted forever') ?>.
|
||||
<?= Yii::t('user', 'Please be certain') ?>.
|
||||
</p>
|
||||
<?= Html::a(Yii::t('user', 'Delete account'), ['delete'], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data-method' => 'post',
|
||||
'data-confirm' => Yii::t('user', 'Are you sure? There is no going back'),
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
72
lib/User/resources/views/settings/networks.php
Normal file
72
lib/User/resources/views/settings/networks.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?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;
|
||||
|
||||
/*
|
||||
* @var yii\web\View $this
|
||||
* @var yii\widgets\ActiveForm $form
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Networks');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<?= $this->render('/_alert', ['module' => Yii::$app->getModule('user')]) ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $this->render('_menu') ?>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<?= Html::encode($this->title) ?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<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([
|
||||
'baseAuthUrl' => ['/user/security/auth'],
|
||||
'accounts' => $user->accounts,
|
||||
'autoRender' => false,
|
||||
'popupMode' => false,
|
||||
]) ?>
|
||||
<table class="table">
|
||||
<?php foreach ($auth->getClients() as $client): ?>
|
||||
<tr>
|
||||
<td style="width: 32px; vertical-align: middle">
|
||||
<?= Html::tag('span', '', ['class' => 'auth-icon ' . $client->getName()]) ?>
|
||||
</td>
|
||||
<td style="vertical-align: middle">
|
||||
<strong><?= $client->getTitle() ?></strong>
|
||||
</td>
|
||||
<td style="width: 120px">
|
||||
<?= $auth->isConnected($client) ?
|
||||
Html::a(Yii::t('user', 'Disconnect'), $auth->createClientUrl($client), [
|
||||
'class' => 'btn btn-danger btn-block',
|
||||
'data-method' => 'post',
|
||||
]) :
|
||||
Html::a(Yii::t('user', 'Connect'), $auth->createClientUrl($client), [
|
||||
'class' => 'btn btn-success btn-block',
|
||||
])
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php Connect::end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
90
lib/User/resources/views/settings/profile.php
Normal file
90
lib/User/resources/views/settings/profile.php
Normal file
@ -0,0 +1,90 @@
|
||||
<?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 yii\widgets\ActiveForm $form
|
||||
* @var dektrium\user\models\Profile $profile
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('user', 'Profile settings');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<?= $this->render('/_alert', ['module' => Yii::$app->getModule('user')]) ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $this->render('_menu') ?>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<?= Html::encode($this->title) ?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = \yii\widgets\ActiveForm::begin([
|
||||
'id' => 'profile-form',
|
||||
'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>",
|
||||
'labelOptions' => ['class' => 'col-lg-3 control-label'],
|
||||
],
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
'validateOnBlur' => false,
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'name') ?>
|
||||
|
||||
<?= $form->field($model, 'public_email') ?>
|
||||
|
||||
<?= $form->field($model, 'website') ?>
|
||||
|
||||
<?= $form->field($model, 'location') ?>
|
||||
|
||||
<?= $form
|
||||
->field($model, 'timezone')
|
||||
->dropDownList(
|
||||
\yii\helpers\ArrayHelper::map(
|
||||
\dektrium\user\helpers\Timezone::getAll(),
|
||||
'timezone',
|
||||
'name'
|
||||
)
|
||||
); ?>
|
||||
|
||||
<?= $form
|
||||
->field($model, 'gravatar_email')
|
||||
->hint(
|
||||
\yii\helpers\Html::a(
|
||||
Yii::t('user', 'Change your avatar at Gravatar.com'),
|
||||
'http://gravatar.com'
|
||||
)
|
||||
) ?>
|
||||
|
||||
<?= $form->field($model, 'bio')->textarea() ?>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-3 col-lg-9">
|
||||
<?= \yii\helpers\Html::submitButton(
|
||||
Yii::t('user', 'Save'),
|
||||
['class' => 'btn btn-block btn-success']
|
||||
) ?><br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php \yii\widgets\ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
32
lib/User/resources/views/shared/_alert.php
Normal file
32
lib/User/resources/views/shared/_alert.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?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\bootstrap\Alert;
|
||||
|
||||
/**
|
||||
* @var dektrium\user\Module $module
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php if ($module->enableFlashMessages): ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<?php foreach (Yii::$app->session->getAllFlashes() as $type => $message): ?>
|
||||
<?php if (in_array($type, ['success', 'danger', 'warning', 'info'])): ?>
|
||||
<?= Alert::widget([
|
||||
'options' => ['class' => 'alert-dismissible alert-'.$type],
|
||||
'body' => $message
|
||||
]) ?>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
23
lib/User/resources/views/shared/message.php
Normal file
23
lib/User/resources/views/shared/message.php
Normal file
@ -0,0 +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 yii\web\View $this
|
||||
* @var dektrium\user\Module $module
|
||||
*/
|
||||
|
||||
$this->title = $title;
|
||||
|
||||
?>
|
||||
|
||||
<?= $this->render('/_alert', [
|
||||
'module' => $module,
|
||||
]);
|
||||
Reference in New Issue
Block a user