diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml
index 262d875c..880f9ee3 100644
--- a/.github/workflows/php.yml
+++ b/.github/workflows/php.yml
@@ -14,11 +14,11 @@ jobs:
fail-fast: false
matrix:
operating-system: ['ubuntu-latest']
- php-versions: ['8.2','8.1', '8.0','7.4']
+ php-versions: ['8.3', '8.2','8.1', '8.0','7.4']
services:
mariadb:
- image: mariadb:10
+ image: mariadb:latest
ports:
- 3306:3306
env:
@@ -26,7 +26,7 @@ jobs:
MYSQL_PASSWORD: password
MYSQL_DATABASE: yii2-usuario-test
MYSQL_ROOT_PASSWORD: password
- options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
+ options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=5s --health-timeout=5s --health-retries=3
steps:
diff --git a/docs/guides/migrating-to-v2.md b/docs/guides/migrating-to-v2.md
new file mode 100644
index 00000000..8b2c7dd9
--- /dev/null
+++ b/docs/guides/migrating-to-v2.md
@@ -0,0 +1,31 @@
+# Migrating from v1 to v2
+
+
+The main change in v2 is decoupling the UI framework from the module base code in order to allow supporting mulitple
+UI frameworks simultaneously. Eg bootstrab 3/4/5 or any other ui framework. To be able to do this v2 is not including
+the Bootstrap as a required dependency anymore.
+
+The module includes the view files for both Bootstrap 3 and Bootstrap 5. The default views for v2 are Bootstrap 5, but
+either way the bootstrap dependencies must be specified by your project composer.json requirements depending on which
+version you choose to use.
+
+## Using with old Bootstrap 3
+In order to continue with the _old_ Bootstrap 3 views. you need to:
+
+1. make sure you have the followin packakges included in your composer.json "require" section:
+```
+"2amigos/yii2-selectize-widget": "^1.1",
+"yiisoft/yii2-bootstrap": "^2.0",
+```
+
+2. Change the usuario Module 'viewPath' paramater to a folder containing Bootstrap 3 views, eg the included:
+`'viewPath' => '@Da/User/resources/views/bootstrap3',`
+
+## Using with old Bootstrap 5
+1. make sure you have the followin packakges included in your composer.json "require" section:
+```
+"yiisoft/yii2-bootstrap5",
+"kartik-v/yii2-widget-select",
+"twbs/bootstrap-icons",
+```
+2. The default 'viewPath' for v2 Module is Bootstrap 5 views in '@Da/User/resources/views/bootstrap5'.
diff --git a/docs/index.md b/docs/index.md
index ba11ab67..0bfd8f74 100755
--- a/docs/index.md
+++ b/docs/index.md
@@ -189,6 +189,7 @@ Helpful Guides
- [Separate Frontend and Backend Sessions](guides/separate-frontend-and-backend-sessions.md)
- [Social Network Authentication](guides/social-network-authentication.md)
- [How to Enable session history](guides/how-to-use-session-history.md)
+- [Migrating from v1 to v2](guides/migrating-to-v2.md)
Contributing
------------
diff --git a/phpstan.neon b/phpstan.neon
index 82b0ee8c..bce03bcc 100644
--- a/phpstan.neon
+++ b/phpstan.neon
@@ -3,6 +3,7 @@ parameters:
paths:
- src
excludePaths:
- - 'src/resources/i18n/*'
+ - 'src/User/resources/i18n/*'
+ - 'src/User/resources/views/bootstrap3/*'
bootstrapFiles:
- stan_autoload.php
diff --git a/src/User/Module.php b/src/User/Module.php
index d8b4e03d..2cbbcda1 100755
--- a/src/User/Module.php
+++ b/src/User/Module.php
@@ -224,7 +224,11 @@ class Module extends BaseModule
/**
* @var string
*/
- public $viewPath = '@Da/User/resources/views';
+ public $viewPath = '@Da/User/resources/views/bootstrap5';
+ /**
+ * @var string the mail views path is UI framework independent
+ */
+ public $mailViewPath = '@Da/User/resources/views/mail';
/**
* @var string the session key name to impersonate users. Please, modify it for security reasons!
*/
diff --git a/src/User/Service/MailService.php b/src/User/Service/MailService.php
index 4e99d443..4aeefc22 100644
--- a/src/User/Service/MailService.php
+++ b/src/User/Service/MailService.php
@@ -51,7 +51,7 @@ public function __construct($type, $from, $to, $subject, $view, array $params, M
$this->view = $view;
$this->params = $params;
$this->mailer = $mailer;
- $this->viewPath = $this->getModule()->viewPath . '/mail';
+ $this->viewPath = $this->getModule()->mailViewPath;
$this->mailer->setViewPath($this->viewPath);
$this->mailer->getView()->theme = Yii::$app->view->theme;
}
diff --git a/src/User/resources/views/bootstrap3/admin/_account.php b/src/User/resources/views/bootstrap3/admin/_account.php
new file mode 100644
index 00000000..7b440214
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/admin/_account.php
@@ -0,0 +1,46 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use yii\bootstrap\ActiveForm;
+use yii\helpers\Html;
+
+/** @var yii\web\View $this */
+/** @var Da\User\Model\User $user */
+/** @var \Da\User\Module $module */
+
+?>
+
+beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?>
+
+ 'horizontal',
+ 'enableAjaxValidation' => true,
+ 'enableClientValidation' => false,
+ 'fieldConfig' => [
+ 'horizontalCssClasses' => [
+ 'wrapper' => 'col-sm-9',
+ ],
+ ],
+ ]
+); ?>
+
+= $this->render('/admin/_user', ['form' => $form, 'user' => $user]) ?>
+
+
+
+
+
+endContent() ?>
diff --git a/src/User/resources/views/bootstrap3/admin/_assignments.php b/src/User/resources/views/bootstrap3/admin/_assignments.php
new file mode 100644
index 00000000..d2b0a729
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/admin/_assignments.php
@@ -0,0 +1,34 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use Da\User\Widget\AssignmentsWidget;
+
+/** @var yii\web\View $this */
+/** @var Da\User\Model\User $user */
+/** @var string[] $params */
+/** @var \Da\User\Module $module */
+
+?>
+
+beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?>
+
+= yii\bootstrap\Alert::widget(
+ [
+ 'options' => [
+ 'class' => 'alert-info alert-dismissible',
+ ],
+ 'body' => Yii::t('usuario', 'You can assign multiple roles or permissions to user by using the form below'),
+ ]
+) ?>
+
+= AssignmentsWidget::widget(['userId' => $user->id, 'params' => $params]) ?>
+
+endContent() ?>
diff --git a/src/User/resources/views/admin/_info.php b/src/User/resources/views/bootstrap3/admin/_info.php
similarity index 100%
rename from src/User/resources/views/admin/_info.php
rename to src/User/resources/views/bootstrap3/admin/_info.php
diff --git a/src/User/resources/views/bootstrap3/admin/_profile.php b/src/User/resources/views/bootstrap3/admin/_profile.php
new file mode 100644
index 00000000..17994bea
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/admin/_profile.php
@@ -0,0 +1,55 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use yii\bootstrap\ActiveForm;
+use yii\helpers\Html;
+
+/**
+ * @var yii\web\View $this
+ * @var \Da\User\Model\User $user
+ * @var \Da\User\Model\Profile $profile
+ * @var \Da\User\Module $module
+ */
+
+?>
+
+beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?>
+
+ '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() ?>
+
+
+
+
+
+
+endContent() ?>
diff --git a/src/User/resources/views/bootstrap3/admin/_session-history.php b/src/User/resources/views/bootstrap3/admin/_session-history.php
new file mode 100755
index 00000000..df1ad7b2
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/admin/_session-history.php
@@ -0,0 +1,70 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use Da\User\Widget\SessionStatusWidget;
+use yii\helpers\Html;
+use yii\grid\GridView;
+use yii\widgets\Pjax;
+use Da\User\Model\SessionHistory;
+use Da\User\Search\SessionHistorySearch;
+use yii\web\View;
+use yii\data\ActiveDataProvider;
+
+/**
+ * @var View $this
+ * @var SessionHistorySearch $searchModel
+ * @var ActiveDataProvider $dataProvider
+ * @var \Da\User\Model\User $user
+ * @var \Da\User\Module $module
+ */
+?>
+
+beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?>
+
+
+ = Html::a(
+ Yii::t('usuario', 'Terminate all sessions'),
+ ['/user/admin/terminate-sessions', 'id' => $user->id],
+ [
+ 'class' => 'btn btn-danger btn-xs pull-right',
+ 'data-method' => 'post'
+ ]
+ ) ?>
+
+
+
+
+
+
+= GridView::widget([
+ 'dataProvider' => $dataProvider,
+ 'filterModel' => $searchModel,
+ 'columns' => [
+ 'user_agent',
+ 'ip',
+ [
+ 'contentOptions' => [
+ 'class' => 'text-nowrap',
+ ],
+ 'label' => Yii::t('usuario', 'Status'),
+ 'value' => function (SessionHistory $model) {
+ return SessionStatusWidget::widget(['model' => $model]);
+ },
+ ],
+ [
+ 'attribute' => 'updated_at',
+ 'format' => 'datetime'
+ ],
+ ],
+]); ?>
+
+
+endContent() ?>
diff --git a/src/User/resources/views/admin/_user.php b/src/User/resources/views/bootstrap3/admin/_user.php
similarity index 100%
rename from src/User/resources/views/admin/_user.php
rename to src/User/resources/views/bootstrap3/admin/_user.php
diff --git a/src/User/resources/views/bootstrap3/admin/create.php b/src/User/resources/views/bootstrap3/admin/create.php
new file mode 100644
index 00000000..f65d7de1
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/admin/create.php
@@ -0,0 +1,119 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE 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 \Da\User\Model\User $user
+ */
+
+$this->title = Yii::t('usuario', 'Create a user account');
+$this->params['breadcrumbs'][] = ['label' => Yii::t('usuario', 'Users'), 'url' => ['index']];
+$this->params['breadcrumbs'][] = $this->title;
+
+?>
+
+= $this->render(
+ '/shared/_alert',
+ [
+ 'module' => Yii::$app->getModule('user'),
+ ]
+) ?>
+
+
+
+
+
+
= Html::encode($this->title) ?>
+
+
+ = $this->render('/shared/_menu') ?>
+
+
+
+
+ = Nav::widget(
+ [
+ 'options' => [
+ 'class' => 'nav-pills nav-stacked',
+ ],
+ 'items' => [
+ [
+ 'label' => Yii::t('usuario', 'Account details'),
+ 'url' => ['/user/admin/create'],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Profile details'),
+ 'options' => [
+ 'class' => 'disabled',
+ 'onclick' => 'return false;',
+ ],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Information'),
+ 'options' => [
+ 'class' => 'disabled',
+ 'onclick' => 'return false;',
+ ],
+ ],
+ ],
+ ]
+ ) ?>
+
+
+
+
+
+
+
+ = Yii::t('usuario', 'Credentials will be sent to the user by email') ?>.
+ = Yii::t(
+ 'usuario',
+ 'A password will be generated automatically if not provided'
+ ) ?>.
+
+ 'horizontal',
+ 'enableAjaxValidation' => true,
+ 'enableClientValidation' => false,
+ 'fieldConfig' => [
+ 'horizontalCssClasses' => [
+ 'wrapper' => 'col-sm-9',
+ ],
+ ],
+ ]
+ ); ?>
+
+ = $this->render('/admin/_user', ['form' => $form, 'user' => $user]) ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/admin/index.php b/src/User/resources/views/bootstrap3/admin/index.php
new file mode 100644
index 00000000..a991fda0
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/admin/index.php
@@ -0,0 +1,198 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use yii\grid\GridView;
+use yii\helpers\Html;
+use yii\web\View;
+use yii\widgets\Pjax;
+
+/**
+ * @var yii\web\View $this
+ * @var yii\data\ActiveDataProvider $dataProvider
+ * @var Da\User\Search\UserSearch $searchModel
+ * @var Da\User\Module $module
+ */
+
+$this->title = Yii::t('usuario', 'Manage users');
+$this->params['breadcrumbs'][] = $this->title;
+
+?>
+
+beginContent($module->viewPath . '/shared/admin_layout.php') ?>
+
+
+
+= 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
+ ? '
' . Yii::t('usuario', '(not set)') . ' '
+ : $model->registration_ip;
+ },
+ 'format' => 'html',
+ 'visible' => !$module->disableIpLogging,
+ ],
+ [
+ 'attribute' => 'created_at',
+ 'value' => function ($model) {
+ if (extension_loaded('intl')) {
+ return Yii::t('usuario', '{0, date, MMM dd, YYYY HH:mm}', [$model->created_at]);
+ }
+
+ return date('Y-m-d G:i:s', $model->created_at);
+ },
+ ],
+ [
+ 'attribute' => 'last_login_at',
+ 'value' => function ($model) {
+ if (!$model->last_login_at || $model->last_login_at == 0) {
+ return Yii::t('usuario', 'Never');
+ } elseif (extension_loaded('intl')) {
+ return Yii::t('usuario', '{0, date, MMM dd, YYYY HH:mm}', [$model->last_login_at]);
+ } else {
+ return date('Y-m-d G:i:s', $model->last_login_at);
+ }
+ },
+ ],
+ [
+ 'attribute' => 'last_login_ip',
+ 'value' => function ($model) {
+ return $model->last_login_ip == null
+ ? '
' . Yii::t('usuario', '(not set)') . ' '
+ : $model->last_login_ip;
+ },
+ 'format' => 'html',
+ 'visible' => !$module->disableIpLogging,
+ ],
+ [
+ 'header' => Yii::t('usuario', 'Confirmation'),
+ 'value' => function ($model) {
+ if ($model->isConfirmed) {
+ return '
+ ' . Yii::t('usuario', 'Confirmed') . '
+
';
+ }
+
+ return Html::a(
+ Yii::t('usuario', 'Confirm'),
+ ['confirm', 'id' => $model->id],
+ [
+ 'class' => 'btn btn-xs btn-success btn-block',
+ 'data-method' => 'post',
+ 'data-confirm' => Yii::t('usuario', 'Are you sure you want to confirm this user?'),
+ ]
+ );
+ },
+ 'format' => 'raw',
+ 'visible' => Yii::$app->getModule('user')->enableEmailConfirmation,
+ ],
+ 'password_age',
+ [
+ 'header' => Yii::t('usuario', 'Block status'),
+ 'value' => function ($model) {
+ if ($model->isBlocked) {
+ return Html::a(
+ Yii::t('usuario', 'Unblock'),
+ ['block', 'id' => $model->id],
+ [
+ 'class' => 'btn btn-xs btn-success btn-block',
+ 'data-method' => 'post',
+ 'data-confirm' => Yii::t('usuario', 'Are you sure you want to unblock this user?'),
+ ]
+ );
+ }
+
+ return Html::a(
+ Yii::t('usuario', 'Block'),
+ ['block', 'id' => $model->id],
+ [
+ 'class' => 'btn btn-xs btn-danger btn-block',
+ 'data-method' => 'post',
+ 'data-confirm' => Yii::t('usuario', 'Are you sure you want to block this user?'),
+ ]
+ );
+ },
+ 'format' => 'raw',
+ ],
+ [
+ 'class' => 'yii\grid\ActionColumn',
+ 'template' => '{switch} {reset} {force-password-change} {update} {delete}',
+ 'buttons' => [
+ 'switch' => function ($url, $model) use ($module) {
+ if ($model->id != Yii::$app->user->id && $module->enableSwitchIdentities) {
+ return Html::a(
+ '
',
+ ['/user/admin/switch-identity', 'id' => $model->id],
+ [
+ 'title' => Yii::t('usuario', 'Impersonate this user'),
+ 'data-confirm' => Yii::t(
+ 'usuario',
+ 'Are you sure you want to switch to this user for the rest of this Session?'
+ ),
+ 'data-method' => 'POST',
+ ]
+ );
+ }
+
+ return null;
+ },
+ 'reset' => function ($url, $model) use ($module) {
+ if($module->allowAdminPasswordRecovery) {
+ return Html::a(
+ '
',
+ ['/user/admin/password-reset', 'id' => $model->id],
+ [
+ 'title' => Yii::t('usuario', 'Send password recovery email'),
+ 'data-confirm' => Yii::t(
+ 'usuario',
+ 'Are you sure you wish to send a password recovery email to this user?'
+ ),
+ 'data-method' => 'POST',
+ ]
+ );
+ }
+
+ return null;
+ },
+ 'force-password-change' => function ($url, $model) use ($module) {
+ if (is_null($module->maxPasswordAge)) {
+ return null;
+ }
+ return Html::a(
+ '
',
+ ['/user/admin/force-password-change', 'id' => $model->id],
+ [
+ 'title' => Yii::t('usuario', 'Force password change at next login'),
+ 'data-confirm' => Yii::t(
+ 'usuario',
+ 'Are you sure you wish the user to change their password at next login?'
+ ),
+ 'data-method' => 'POST',
+ ]
+ );
+ },
+ ]
+ ],
+ ],
+ ]
+); ?>
+
+
+
+endContent() ?>
diff --git a/src/User/resources/views/bootstrap3/admin/update.php b/src/User/resources/views/bootstrap3/admin/update.php
new file mode 100755
index 00000000..a90fd96f
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/admin/update.php
@@ -0,0 +1,147 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use Da\User\Model\User;
+use yii\bootstrap\Nav;
+use yii\helpers\Html;
+use yii\web\View;
+use Da\User\Module as UserModule;
+
+/**
+ * @var View $this
+ * @var User $user
+ * @var string $content
+ */
+
+$this->title = Yii::t('usuario', 'Update user account');
+$this->params['breadcrumbs'][] = ['label' => Yii::t('usuario', 'Users'), 'url' => ['index']];
+$this->params['breadcrumbs'][] = $this->title;
+
+/** @var UserModule $module */
+$module = Yii::$app->getModule('user');
+?>
+
+= $this->render(
+ '/shared/_alert',
+ [
+ 'module' => $module,
+ ]
+) ?>
+
+
+
+
+
+
= Html::encode($this->title) ?>
+
+
+ = $this->render('/shared/_menu') ?>
+
+
+
+
+ = Nav::widget(
+ [
+ 'options' => [
+ 'class' => 'nav-pills nav-stacked',
+ ],
+ 'items' => [
+ [
+ 'label' => Yii::t('usuario', 'Account details'),
+ 'url' => ['/user/admin/update', 'id' => $user->id],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Profile details'),
+ 'url' => ['/user/admin/update-profile', 'id' => $user->id],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Information'),
+ 'url' => ['/user/admin/info', 'id' => $user->id],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Assignments'),
+ 'url' => ['/user/admin/assignments', 'id' => $user->id],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Session history'),
+ 'url' => ['/user/admin/session-history', 'id' => $user->id],
+ 'visible' => $module->enableSessionHistory,
+ ],
+ '
',
+ [
+ 'label' => Yii::t('usuario', 'Confirm'),
+ 'url' => ['/user/admin/confirm', 'id' => $user->id],
+ 'visible' => !$user->isConfirmed,
+ 'linkOptions' => [
+ 'class' => 'text-success',
+ 'data-method' => 'post',
+ 'data-confirm' => Yii::t(
+ 'usuario',
+ 'Are you sure you want to confirm this user?'
+ ),
+ ],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Block'),
+ 'url' => ['/user/admin/block', 'id' => $user->id],
+ 'visible' => !$user->isBlocked,
+ 'linkOptions' => [
+ 'class' => 'text-danger',
+ 'data-method' => 'post',
+ 'data-confirm' => Yii::t(
+ 'usuario',
+ 'Are you sure you want to block this user?'
+ ),
+ ],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Unblock'),
+ 'url' => ['/user/admin/block', 'id' => $user->id],
+ 'visible' => $user->isBlocked,
+ 'linkOptions' => [
+ 'class' => 'text-success',
+ 'data-method' => 'post',
+ 'data-confirm' => Yii::t(
+ 'usuario',
+ 'Are you sure you want to unblock this user?'
+ ),
+ ],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Delete'),
+ 'url' => ['/user/admin/delete', 'id' => $user->id],
+ 'linkOptions' => [
+ 'class' => 'text-danger',
+ 'data-method' => 'post',
+ 'data-confirm' => Yii::t(
+ 'usuario',
+ 'Are you sure you want to delete this user?'
+ ),
+ ],
+ ],
+ ],
+ ]
+ ) ?>
+
+
+
+
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/permission/_form.php b/src/User/resources/views/bootstrap3/permission/_form.php
new file mode 100644
index 00000000..1ab6575e
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/permission/_form.php
@@ -0,0 +1,57 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use dosamigos\selectize\SelectizeDropDownList;
+use yii\helpers\ArrayHelper;
+use yii\helpers\Html;
+use yii\widgets\ActiveForm;
+
+/**
+ * @var yii\web\View $this
+ * @var Da\User\Model\Permission $model
+ * @var string[] $unassignedItems
+ */
+
+?>
+
+ false,
+ 'enableAjaxValidation' => true,
+ ]
+) ?>
+
+= $form->field($model, 'name') ?>
+
+= $form->field($model, 'description') ?>
+
+= $form->field($model, 'rule')->widget(SelectizeDropDownList::class, [
+ 'items' => ArrayHelper::map(Yii::$app->getAuthManager()->getRules(), 'name', 'name'),
+ 'options' => [
+ 'prompt' => Yii::t('usuario', 'Select rule...'),
+ ]
+]) ?>
+
+
+= $form->field($model, 'children')->widget(
+ SelectizeDropDownList::class,
+ [
+ 'items' => $unassignedItems,
+ 'options' => [
+ 'id' => 'children',
+ 'multiple' => true,
+ ],
+ ]
+) ?>
+
+= Html::submitButton(Yii::t('usuario', 'Save'), ['class' => 'btn btn-success btn-block']) ?>
+
+
diff --git a/src/User/resources/views/permission/create.php b/src/User/resources/views/bootstrap3/permission/create.php
similarity index 100%
rename from src/User/resources/views/permission/create.php
rename to src/User/resources/views/bootstrap3/permission/create.php
diff --git a/src/User/resources/views/permission/index.php b/src/User/resources/views/bootstrap3/permission/index.php
similarity index 100%
rename from src/User/resources/views/permission/index.php
rename to src/User/resources/views/bootstrap3/permission/index.php
diff --git a/src/User/resources/views/permission/update.php b/src/User/resources/views/bootstrap3/permission/update.php
similarity index 100%
rename from src/User/resources/views/permission/update.php
rename to src/User/resources/views/bootstrap3/permission/update.php
diff --git a/src/User/resources/views/bootstrap3/profile/show.php b/src/User/resources/views/bootstrap3/profile/show.php
new file mode 100644
index 00000000..a101a975
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/profile/show.php
@@ -0,0 +1,71 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use yii\helpers\Html;
+
+/**
+ * @var \yii\web\View $this
+ * @var \Da\User\Model\Profile $profile
+ */
+
+$this->title = empty($profile->name) ? Html::encode($profile->user->username) : Html::encode($profile->name);
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+
+
+ = Html::img(
+ $profile->getAvatarUrl(230),
+ [
+ 'class' => 'img-rounded img-responsive',
+ 'alt' => $profile->user->username,
+ ]
+ ) ?>
+
+
+
= $this->title ?>
+
+ location)): ?>
+
+
+ = Html::encode($profile->location) ?>
+
+
+ website)): ?>
+
+
+ = Html::a(Html::encode($profile->website), Html::encode($profile->website)) ?>
+
+
+ public_email)): ?>
+
+
+ = Html::a(
+ Html::encode($profile->public_email),
+ 'mailto:' .
+ Html::encode($profile->public_email)
+ )
+ ?>
+
+
+
+
+ = Yii::t('usuario', 'Joined on {0, date}', $profile->user->created_at) ?>
+
+
+ bio)): ?>
+
= Html::encode($profile->bio) ?>
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/recovery/request.php b/src/User/resources/views/bootstrap3/recovery/request.php
new file mode 100644
index 00000000..6b0b6d71
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/recovery/request.php
@@ -0,0 +1,47 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE 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 \Da\User\Form\RecoveryForm $model
+ */
+
+$this->title = Yii::t('usuario', 'Recover your password');
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+
+
+
= Html::encode($this->title) ?>
+
+
+ $model->formName(),
+ 'enableAjaxValidation' => true,
+ 'enableClientValidation' => false,
+ ]
+ ); ?>
+
+ = $form->field($model, 'email')->textInput(['autofocus' => true]) ?>
+
+ = Html::submitButton(Yii::t('usuario', 'Continue'), ['class' => 'btn btn-primary btn-block']) ?>
+
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/recovery/reset.php b/src/User/resources/views/bootstrap3/recovery/reset.php
new file mode 100644
index 00000000..8f225f1c
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/recovery/reset.php
@@ -0,0 +1,47 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE 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 \Da\User\Form\RecoveryForm $model
+ */
+
+$this->title = Yii::t('usuario', 'Reset your password');
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+
+
+
= Html::encode($this->title) ?>
+
+
+ $model->formName(),
+ 'enableAjaxValidation' => true,
+ 'enableClientValidation' => false,
+ ]
+ ); ?>
+
+ = $form->field($model, 'password')->passwordInput() ?>
+
+ = Html::submitButton(Yii::t('usuario', 'Finish'), ['class' => 'btn btn-success btn-block']) ?>
+
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/registration/connect.php b/src/User/resources/views/bootstrap3/registration/connect.php
new file mode 100644
index 00000000..e6e8a505
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/registration/connect.php
@@ -0,0 +1,65 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE 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 \Da\User\Model\User $model
+ * @var \Da\User\Model\SocialNetworkAccount $account
+ */
+
+$this->title = Yii::t('usuario', 'Sign in');
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+
+
+
= Html::encode($this->title) ?>
+
+
+
+
+ = Yii::t(
+ 'usuario',
+ 'In order to finish your registration, we need you to enter following fields'
+ ) ?>:
+
+
+ $model->formName(),
+ ]
+ ); ?>
+
+ = $form->field($model, 'email') ?>
+
+ = $form->field($model, 'username') ?>
+
+ = Html::submitButton(Yii::t('usuario', 'Continue'), ['class' => 'btn btn-success btn-block']) ?>
+
+
+
+
+
+ = Html::a(
+ Yii::t(
+ 'usuario',
+ 'If you already registered, sign in and connect this account on settings page'
+ ),
+ ['/user/settings/networks']
+ ) ?>.
+
+
+
diff --git a/src/User/resources/views/bootstrap3/registration/register.php b/src/User/resources/views/bootstrap3/registration/register.php
new file mode 100644
index 00000000..29d1e753
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/registration/register.php
@@ -0,0 +1,61 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use yii\helpers\Html;
+use yii\widgets\ActiveForm;
+
+/**
+ * @var yii\web\View $this
+ * @var \Da\User\Form\RegistrationForm $model
+ * @var \Da\User\Model\User $user
+ * @var \Da\User\Module $module
+ */
+
+$this->title = Yii::t('usuario', 'Sign up');
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+
+
+
= Html::encode($this->title) ?>
+
+
+ $model->formName(),
+ 'enableAjaxValidation' => true,
+ 'enableClientValidation' => false,
+ ]
+ ); ?>
+
+ = $form->field($model, 'email')->textInput(['autofocus' => true]) ?>
+
+ = $form->field($model, 'username') ?>
+
+ generatePasswords === false): ?>
+ = $form->field($model, 'password')->passwordInput() ?>
+
+
+ enableGdprCompliance): ?>
+ = $form->field($model, 'gdpr_consent')->checkbox(['value' => 1]) ?>
+
+
+ = Html::submitButton(Yii::t('usuario', 'Sign up'), ['class' => 'btn btn-success btn-block']) ?>
+
+
+
+
+
+ = Html::a(Yii::t('usuario', 'Already registered? Sign in!'), ['/user/security/login']) ?>
+
+
+
diff --git a/src/User/resources/views/bootstrap3/registration/resend.php b/src/User/resources/views/bootstrap3/registration/resend.php
new file mode 100644
index 00000000..b687a1e9
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/registration/resend.php
@@ -0,0 +1,46 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use yii\helpers\Html;
+use yii\widgets\ActiveForm;
+
+/**
+ * @var yii\web\View $this
+ * @var \Da\User\Form\ResendForm $model
+ */
+
+$this->title = Yii::t('usuario', 'Request new confirmation message');
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+
+
+
= Html::encode($this->title) ?>
+
+
+ $model->formName(),
+ 'enableAjaxValidation' => true,
+ 'enableClientValidation' => false,
+ ]
+ ); ?>
+
+ = $form->field($model, 'email')->textInput(['autofocus' => true]) ?>
+
+ = Html::submitButton(Yii::t('usuario', 'Continue'), ['class' => 'btn btn-primary btn-block']) ?>
+
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/role/_form.php b/src/User/resources/views/bootstrap3/role/_form.php
new file mode 100644
index 00000000..33eb2e93
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/role/_form.php
@@ -0,0 +1,57 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+/**
+ * @var yii\web\View $this
+ * @var \Da\User\Model\Role $model
+ */
+
+use Da\User\Helper\AuthHelper;
+use dosamigos\selectize\SelectizeDropDownList;
+use yii\helpers\ArrayHelper;
+use yii\helpers\Html;
+use yii\widgets\ActiveForm;
+
+$unassignedItems = Yii::$container->get(AuthHelper::class)->getUnassignedItems($model);
+?>
+
+ false,
+ 'enableAjaxValidation' => true,
+ ]
+) ?>
+
+= $form->field($model, 'name') ?>
+
+= $form->field($model, 'description') ?>
+
+= $form->field($model, 'rule')->widget(SelectizeDropDownList::class, [
+ 'items' => ArrayHelper::map(Yii::$app->getAuthManager()->getRules(), 'name', 'name'),
+ 'options' => [
+ 'prompt' => 'Select rule...'
+ ]
+]) ?>
+
+= $form->field($model, 'children')->widget(
+ SelectizeDropDownList::class,
+ [
+ 'items' => $unassignedItems,
+ 'options' => [
+ 'id' => 'children',
+ 'multiple' => true,
+ ],
+ ]
+) ?>
+
+= Html::submitButton(Yii::t('usuario', 'Save'), ['class' => 'btn btn-success btn-block']) ?>
+
+
diff --git a/src/User/resources/views/role/create.php b/src/User/resources/views/bootstrap3/role/create.php
similarity index 100%
rename from src/User/resources/views/role/create.php
rename to src/User/resources/views/bootstrap3/role/create.php
diff --git a/src/User/resources/views/role/index.php b/src/User/resources/views/bootstrap3/role/index.php
similarity index 100%
rename from src/User/resources/views/role/index.php
rename to src/User/resources/views/bootstrap3/role/index.php
diff --git a/src/User/resources/views/role/update.php b/src/User/resources/views/bootstrap3/role/update.php
similarity index 100%
rename from src/User/resources/views/role/update.php
rename to src/User/resources/views/bootstrap3/role/update.php
diff --git a/src/User/resources/views/bootstrap3/rule/_form.php b/src/User/resources/views/bootstrap3/rule/_form.php
new file mode 100644
index 00000000..498a0a82
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/rule/_form.php
@@ -0,0 +1,27 @@
+
+
+
+ false,
+ 'enableAjaxValidation' => true,
+ ]
+) ?>
+
+= $form->field($model, 'name') ?>
+
+= $form->field($model, 'className') ?>
+
+= Html::submitButton(Yii::t('usuario', 'Save'), ['class' => 'btn btn-success btn-block']) ?>
+
+
diff --git a/src/User/resources/views/rule/create.php b/src/User/resources/views/bootstrap3/rule/create.php
similarity index 100%
rename from src/User/resources/views/rule/create.php
rename to src/User/resources/views/bootstrap3/rule/create.php
diff --git a/src/User/resources/views/rule/index.php b/src/User/resources/views/bootstrap3/rule/index.php
similarity index 100%
rename from src/User/resources/views/rule/index.php
rename to src/User/resources/views/bootstrap3/rule/index.php
diff --git a/src/User/resources/views/rule/update.php b/src/User/resources/views/bootstrap3/rule/update.php
similarity index 100%
rename from src/User/resources/views/rule/update.php
rename to src/User/resources/views/bootstrap3/rule/update.php
diff --git a/src/User/resources/views/bootstrap3/security/confirm.php b/src/User/resources/views/bootstrap3/security/confirm.php
new file mode 100644
index 00000000..ed064742
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/security/confirm.php
@@ -0,0 +1,69 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use Da\User\Widget\ConnectWidget;
+use yii\helpers\Html;
+use yii\widgets\ActiveForm;
+
+/**
+ * @var yii\web\View $this
+ * @var \Da\User\Form\LoginForm $model
+ * @var \Da\User\Module $module
+ */
+
+$this->title = Yii::t('usuario', 'Sign in');
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+= $this->render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?>
+
+
+
+
+
+
= Html::encode($this->title) ?>
+
+
+ $model->formName(),
+ 'enableAjaxValidation' => true,
+ 'enableClientValidation' => false,
+ 'validateOnBlur' => false,
+ 'validateOnType' => false,
+ 'validateOnChange' => false,
+ ]
+ ) ?>
+ = $form->field(
+ $model,
+ 'twoFactorAuthenticationCode',
+ ['inputOptions' => ['autofocus' => 'autofocus', 'class' => 'form-control', 'tabindex' => '1']]
+ ) ?>
+
+
+ = Html::a(
+ Yii::t('usuario', 'Cancel'),
+ ['login'],
+ ['class' => 'btn btn-default btn-block', 'tabindex' => '3']
+ ) ?>
+
+
+ = Html::submitButton(
+ Yii::t('usuario', 'Confirm'),
+ ['class' => 'btn btn-primary btn-block', 'tabindex' => '3']
+ ) ?>
+
+
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/security/login.php b/src/User/resources/views/bootstrap3/security/login.php
new file mode 100644
index 00000000..8bbc5cef
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/security/login.php
@@ -0,0 +1,99 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use Da\User\Widget\ConnectWidget;
+use yii\helpers\Html;
+use yii\widgets\ActiveForm;
+
+/**
+ * @var yii\web\View $this
+ * @var \Da\User\Form\LoginForm $model
+ * @var \Da\User\Module $module
+ */
+
+$this->title = Yii::t('usuario', 'Sign in');
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+= $this->render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?>
+
+
+
+
+
+
= Html::encode($this->title) ?>
+
+
+ $model->formName(),
+ '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('usuario', 'Password')
+ . ($module->allowPasswordRecovery ?
+ ' (' . Html::a(
+ Yii::t('usuario', 'Forgot password?'),
+ ['/user/recovery/request'],
+ ['tabindex' => '5']
+ )
+ . ')' : '')
+ ) ?>
+
+ = $form->field($model, 'rememberMe')->checkbox(['tabindex' => '4']) ?>
+
+ = Html::submitButton(
+ Yii::t('usuario', 'Sign in'),
+ ['class' => 'btn btn-primary btn-block', 'tabindex' => '3']
+ ) ?>
+
+
+
+
+ enableEmailConfirmation): ?>
+
+ = Html::a(
+ Yii::t('usuario', 'Didn\'t receive confirmation message?'),
+ ['/user/registration/resend']
+ ) ?>
+
+
+ enableRegistration): ?>
+
+ = Html::a(Yii::t('usuario', 'Don\'t have an account? Sign up!'), ['/user/registration/register']) ?>
+
+
+ = ConnectWidget::widget(
+ [
+ 'baseAuthUrl' => ['/user/security/auth'],
+ ]
+ ) ?>
+
+
diff --git a/src/User/resources/views/bootstrap3/settings/_menu.php b/src/User/resources/views/bootstrap3/settings/_menu.php
new file mode 100755
index 00000000..bd3c2aff
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/settings/_menu.php
@@ -0,0 +1,65 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use yii\helpers\Html;
+use yii\widgets\Menu;
+use Da\User\Module as UserModule;
+use Da\User\Model\User;
+
+/** @var User $user */
+$user = Yii::$app->user->identity;
+/** @var UserModule $module */
+$module = Yii::$app->getModule('user');
+$networksVisible = count(Yii::$app->authClientCollection->clients) > 0;
+
+?>
+
+
+
+
+ = Html::img(
+ $user->profile->getAvatarUrl(24),
+ [
+ 'class' => 'img-rounded',
+ 'alt' => $user->username,
+ ]
+ ) ?>
+ = $user->username ?>
+
+
+
+ = Menu::widget(
+ [
+ 'options' => [
+ 'class' => 'nav nav-pills nav-stacked',
+ ],
+ 'items' => [
+ ['label' => Yii::t('usuario', 'Profile'), 'url' => ['/user/settings/profile']],
+ ['label' => Yii::t('usuario', 'Account'), 'url' => ['/user/settings/account']],
+ [
+ 'label' => Yii::t('usuario', 'Session history'),
+ 'url' => ['/user/settings/session-history'],
+ 'visible' => $module->enableSessionHistory,
+ ],
+ ['label' => Yii::t('usuario', 'Privacy'),
+ 'url' => ['/user/settings/privacy'],
+ 'visible' => $module->enableGdprCompliance
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Networks'),
+ 'url' => ['/user/settings/networks'],
+ 'visible' => $networksVisible,
+ ],
+ ],
+ ]
+ ) ?>
+
+
diff --git a/src/User/resources/views/bootstrap3/settings/account.php b/src/User/resources/views/bootstrap3/settings/account.php
new file mode 100644
index 00000000..71acb076
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/settings/account.php
@@ -0,0 +1,275 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use yii\helpers\Html;
+use yii\helpers\Url;
+use yii\widgets\ActiveForm;
+use dmstr\widgets\Alert;
+
+/**
+ * @var yii\web\View $this
+ * @var yii\widgets\ActiveForm $form
+ * @var \Da\User\Form\SettingsForm $model
+ */
+
+$this->title = Yii::t('usuario', 'Account settings');
+$this->params['breadcrumbs'][] = $this->title;
+
+/** @var \Da\User\Module $module */
+$module = Yii::$app->getModule('user');
+?>
+
+
+= $this->render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?>
+
+
+
+ = $this->render('/settings/_menu') ?>
+
+
+
+
+
= Html::encode($this->title) ?>
+
+
+ $model->formName(),
+ 'options' => ['class' => 'form-horizontal'],
+ 'fieldConfig' => [
+ 'template' => "{label}\n
{input}
\n
{error}\n{hint}
",
+ '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() ?>
+
+
+
+ = $form->field($model, 'current_password')->passwordInput() ?>
+
+
+
+
+
+
+ enableTwoFactorAuthentication): ?>
+
+
+
+
= Yii::t('usuario', 'Two Factor Authentication (2FA)') ?>
+
+
+
+ = Yii::t('usuario', 'Two factor authentication protects you in case of stolen credentials') ?>.
+
+ getUser()->auth_tf_enabled):
+ $validators = $module->twoFactorAuthenticationValidators;
+ $theFirstFound = false;
+ $checked = '';
+ foreach( $validators as $name => $validator ) {
+ if($validator[ "enabled" ]){
+ // I want to check in the radio field the first validator I get
+ if(!$theFirstFound){
+ $checked = 'checked';
+ $theFirstFound = true;
+ }
+ $description = $validator[ "description" ];
+ ?>
+
+ >
+
+ = $description?>
+
+
+
+ = Html::a(
+ Yii::t('usuario', 'Enable two factor authentication'),
+ '#tfmodal',
+ [
+ 'id' => 'enable_tf_btn',
+ 'class' => 'btn btn-info',
+ 'data-toggle' => 'modal',
+ 'data-target' => '#tfmodal'
+ ]
+ ) ?>
+
+
+ getUser()->auth_tf_type;
+ $message = '';
+ switch ($method) {
+ case 'email':
+ $message = Yii::t('usuario', 'The email address set is: "{0}".', [ $model->getUser()->email] );
+ break;
+ case 'sms':
+ $message = Yii::t('usuario', 'The phone number set is: "{0}".', [ $model->getUser()->auth_tf_mobile_phone]);
+ break;
+ }
+ ?>
+ = Yii::t('usuario', 'Your two factor authentication method is based on "{0}".', [$method] ) .' ' . $message ?>
+
+
+ = Html::a(
+ Yii::t('usuario', 'Disable two factor authentication'),
+ ['two-factor-disable', 'id' => $model->getUser()->id],
+ [
+ 'id' => 'disable_tf_btn',
+ 'class' => 'btn btn-warning ',
+ 'data-method' => 'post',
+ 'data-confirm' => Yii::t('usuario', 'This will disable two factor authentication. Are you sure?'),
+ ]
+ ) ?>
+
+
+
+
+
+ module->allowAccountDelete): ?>
+
+
+
= Yii::t('usuario', 'Delete account') ?>
+
+
+
+ = Yii::t('usuario', 'Once you delete your account, there is no going back') ?>.
+ = Yii::t('usuario', 'It will be deleted forever') ?>.
+ = Yii::t('usuario', 'Please be certain') ?>.
+
+
+ = Html::a(
+ Yii::t('usuario', 'Delete account'),
+ ['delete'],
+ [
+ 'class' => 'btn btn-danger',
+ 'data-method' => 'post',
+ 'data-confirm' => Yii::t('usuario', 'Are you sure? There is no going back'),
+ ]
+ ) ?>
+
+
+
+
+
+
+enableTwoFactorAuthentication): ?>
+
+ $model->getUser()->id]);
+ $verify = Url::to(['two-factor-enable', 'id' => $model->getUser()->id]);
+ $mobilePhoneRegistration = Url::to(['two-factor-mobile-phone', 'id' => $model->getUser()->id]);
+ $js = <<registerJs($js);
+ ?>
+
diff --git a/src/User/resources/views/bootstrap3/settings/gdpr-consent.php b/src/User/resources/views/bootstrap3/settings/gdpr-consent.php
new file mode 100644
index 00000000..a7b69ae5
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/settings/gdpr-consent.php
@@ -0,0 +1,35 @@
+
+
+
+
+ $model->formName(),
+ ]
+ ); ?>
+
+
+
= Yii::t('usuario', 'Data privacy') ?>
+
+
+
+
= Yii::t('usuario', 'According to the European General Data Protection Regulation (GDPR) we need your consent to work with your personal data.') ?>
+
+
+ = $form->field($model, 'gdpr_consent')->checkbox(['value' => 1, 'label' => $gdpr_consent_hint])?>
+
+
+
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/settings/gdpr-delete.php b/src/User/resources/views/bootstrap3/settings/gdpr-delete.php
new file mode 100644
index 00000000..2ed34df0
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/settings/gdpr-delete.php
@@ -0,0 +1,60 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use yii\widgets\ActiveForm;
+use yii\helpers\Html;
+
+/** @var \Da\User\Form\GdprDeleteForm $model */
+?>
+
+
+
+
+
+
+ = Yii::t('usuario', 'Delete personal data') ?>
+
+
+
+
= Yii::t('usuario', 'You are about to delete all your personal data from this site.') ?>
+
+ = Yii::t(
+ 'usuario',
+ 'Once you have deleted your data, you will not longer be able to sign in with this account.'
+ ) ?>
+
+
+
+
+
+ = $form->field($model, 'password')->passwordInput() ?>
+
+
+
+
+ = Html::submitButton(Yii::t('usuario', 'Delete'), ['class' => 'btn btn-danger']) ?>
+
+
+
+
+
+ = Html::a(Yii::t('usuario', 'Back to privacy settings'), ['/user/settings/privacy'], ['class' => 'btn btn-info']) ?>
+
+
+
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/settings/networks.php b/src/User/resources/views/bootstrap3/settings/networks.php
new file mode 100644
index 00000000..6d7a74da
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/settings/networks.php
@@ -0,0 +1,86 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+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('usuario', 'Networks');
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+
+= $this->render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?>
+
+
+
+ = $this->render('/settings/_menu') ?>
+
+
+
+
+ = Html::encode($this->title) ?>
+
+
+
+
= Yii::t('usuario', 'You can connect multiple accounts to be able to log in using them') ?>
+ .
+
+ ['/user/security/auth'],
+ 'accounts' => $user->socialNetworkAccounts,
+ 'autoRender' => false,
+ 'popupMode' => false,
+ ]
+ ) ?>
+
+ getClients() as $client): ?>
+
+
+ = Html::tag('span', '', ['class' => 'auth-icon ' . $client->getName()]) ?>
+
+
+ = $client->getTitle() ?>
+
+
+ = $auth->isConnected($client) ?
+ Html::a(
+ Yii::t('usuario', 'Disconnect'),
+ $auth->createClientUrl($client),
+ [
+ 'class' => 'btn btn-danger btn-block',
+ 'data-method' => 'post',
+ ]
+ ) :
+ Html::a(
+ Yii::t('usuario', 'Connect'),
+ $auth->createClientUrl($client),
+ [
+ 'class' => 'btn btn-success btn-block',
+ ]
+ )
+ ?>
+
+
+
+
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/settings/privacy.php b/src/User/resources/views/bootstrap3/settings/privacy.php
new file mode 100644
index 00000000..bc5765ff
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/settings/privacy.php
@@ -0,0 +1,71 @@
+title = Yii::t('usuario', 'Privacy settings');
+
+?>
+
+
+
+ = $this->render('_menu') ?>
+
+
+
+
+
= Html::encode($this->title) ?>
+
+
+
+
+
= Yii::t('usuario', 'Export my data') ?>
+
= Yii::t(
+ 'usuario',
+ 'Here you can download your personal data in a comma separated values format.'
+ ) ?>
+
+ = Html::a(Yii::t('usuario', 'Download my data'),
+ ['/user/settings/export'],
+ [
+ 'class' => 'btn btn-info',
+ 'target' => '_blank'
+ ])
+ ?>
+
+
+
= Yii::t('usuario', 'Delete my account') ?>
+
= Yii::t(
+ 'usuario',
+ 'This will remove your personal data from this site. You will no longer be able to sign in.'
+ ) ?>
+
+ allowAccountDelete): ?>
+ = Html::a(
+ Yii::t('usuario', 'Delete account'),
+ ['delete'],
+ [
+ 'id' => 'gdpr-del-button',
+ 'class' => 'btn btn-danger',
+ 'data-method' => 'post',
+ 'data-confirm' => Yii::t('usuario', 'Are you sure? There is no going back'),
+ ]
+ ) ?>
+ 'btn btn-danger',
+ 'id' => 'gdpr-del-button',
+
+ ])
+ ?>
+
+
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/settings/profile.php b/src/User/resources/views/bootstrap3/settings/profile.php
new file mode 100644
index 00000000..0237aa02
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/settings/profile.php
@@ -0,0 +1,92 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use Da\User\Helper\TimezoneHelper;
+use yii\helpers\ArrayHelper;
+use yii\helpers\Html;
+use yii\widgets\ActiveForm;
+
+/**
+ * @var yii\web\View $this
+ * @var yii\widgets\ActiveForm $form
+ * @var \Da\User\Model\Profile $model
+ * @var TimezoneHelper $timezoneHelper
+ */
+
+$this->title = Yii::t('usuario', 'Profile settings');
+$this->params['breadcrumbs'][] = $this->title;
+$timezoneHelper = $model->make(TimezoneHelper::class);
+?>
+
+
+
+= $this->render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?>
+
+
+
+ = $this->render('_menu') ?>
+
+
+
+
+
= Html::encode($this->title) ?>
+
+
+ $model->formName(),
+ 'options' => ['class' => 'form-horizontal'],
+ 'fieldConfig' => [
+ 'template' => "{label}\n
{input}
\n
{error}\n{hint}
",
+ '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(ArrayHelper::map($timezoneHelper->getAll(), 'timezone', 'name'));
+ ?>
+ = $form
+ ->field($model, 'gravatar_email')
+ ->hint(
+ Html::a(
+ Yii::t('usuario', 'Change your avatar at Gravatar.com'),
+ 'http://gravatar.com',
+ ['target' => '_blank']
+ )
+ ) ?>
+
+ = $form->field($model, 'bio')->textarea() ?>
+
+
+
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/settings/session-history.php b/src/User/resources/views/bootstrap3/settings/session-history.php
new file mode 100755
index 00000000..0c75ec88
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/settings/session-history.php
@@ -0,0 +1,79 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use yii\helpers\Html;
+use yii\grid\GridView;
+use yii\widgets\Pjax;
+use Da\User\Model\SessionHistory;
+use Da\User\Search\SessionHistorySearch;
+use yii\web\View;
+use yii\data\ActiveDataProvider;
+use Da\User\Widget\SessionStatusWidget;
+
+/**
+ * @var View $this
+ * @var SessionHistorySearch $searchModel
+ * @var ActiveDataProvider $dataProvider
+ */
+
+$this->title = Yii::t('usuario', 'Session history');
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+= $this->render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?>
+
+
+
+ = $this->render('/settings/_menu') ?>
+
+
+
+
+ = Html::encode($this->title) ?>
+ = Html::a(
+ Yii::t('usuario', 'Terminate all sessions'),
+ ['/user/settings/terminate-sessions'],
+ [
+ 'class' => 'btn btn-danger btn-xs pull-right',
+ 'data-method' => 'post'
+ ]
+ ) ?>
+
+
+
+
+
+ = GridView::widget([
+ 'dataProvider' => $dataProvider,
+ 'filterModel' => $searchModel,
+ 'columns' => [
+ 'user_agent',
+ 'ip',
+ [
+ 'contentOptions' => [
+ 'class' => 'text-nowrap',
+ ],
+ 'label' => Yii::t('usuario', 'Status'),
+ 'value' => function (SessionHistory $model) {
+ return SessionStatusWidget::widget(['model' => $model]);
+ },
+ ],
+ [
+ 'attribute' => 'updated_at',
+ 'format' => 'datetime'
+ ],
+ ],
+ ]); ?>
+
+
+
+
+
diff --git a/src/User/resources/views/settings/two-factor-email.php b/src/User/resources/views/bootstrap3/settings/two-factor-email.php
similarity index 100%
rename from src/User/resources/views/settings/two-factor-email.php
rename to src/User/resources/views/bootstrap3/settings/two-factor-email.php
diff --git a/src/User/resources/views/settings/two-factor-sms.php b/src/User/resources/views/bootstrap3/settings/two-factor-sms.php
similarity index 100%
rename from src/User/resources/views/settings/two-factor-sms.php
rename to src/User/resources/views/bootstrap3/settings/two-factor-sms.php
diff --git a/src/User/resources/views/settings/two-factor.php b/src/User/resources/views/bootstrap3/settings/two-factor.php
similarity index 100%
rename from src/User/resources/views/settings/two-factor.php
rename to src/User/resources/views/bootstrap3/settings/two-factor.php
diff --git a/src/User/resources/views/bootstrap3/shared/_alert.php b/src/User/resources/views/bootstrap3/shared/_alert.php
new file mode 100644
index 00000000..500385f0
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/shared/_alert.php
@@ -0,0 +1,33 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use yii\bootstrap\Alert;
+
+/** @var \Da\User\Module $module */
+
+?>
+
+enableFlashMessages): ?>
+
+
+ session->getAllFlashes(true) as $type => $message): ?>
+
+ = Alert::widget(
+ [
+ 'options' => ['class' => 'alert-dismissible alert-' . $type],
+ 'body' => $message,
+ ]
+ ) ?>
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/shared/_menu.php b/src/User/resources/views/bootstrap3/shared/_menu.php
new file mode 100644
index 00000000..af7d660f
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/shared/_menu.php
@@ -0,0 +1,62 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE 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('usuario', 'Users'),
+ 'url' => ['/user/admin/index'],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Roles'),
+ 'url' => ['/user/role/index'],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Permissions'),
+ 'url' => ['/user/permission/index'],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Rules'),
+ 'url' => ['/user/rule/index'],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'Create'),
+ 'items' => [
+ [
+ 'label' => Yii::t('usuario', 'New user'),
+ 'url' => ['/user/admin/create'],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'New role'),
+ 'url' => ['/user/role/create'],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'New permission'),
+ 'url' => ['/user/permission/create'],
+ ],
+ [
+ 'label' => Yii::t('usuario', 'New rule'),
+ 'url' => ['/user/rule/create'],
+ ],
+ ],
+ ],
+ ],
+ ]
+) ?>
diff --git a/src/User/resources/views/bootstrap3/shared/admin_layout.php b/src/User/resources/views/bootstrap3/shared/admin_layout.php
new file mode 100644
index 00000000..1716356e
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/shared/admin_layout.php
@@ -0,0 +1,39 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use yii\helpers\Html;
+
+/** @var \yii\web\View $this */
+/** @var string $content */
+
+?>
+
+
+= $this->render(
+ '/shared/_alert',
+ [
+ 'module' => Yii::$app->getModule('user'),
+ ]
+) ?>
+
+
+
+
+
+
= Html::encode($this->title) ?>
+
+
+ = $this->render('/shared/_menu') ?>
+ = $content ?>
+
+
+
+
diff --git a/src/User/resources/views/shared/message.php b/src/User/resources/views/bootstrap3/shared/message.php
similarity index 100%
rename from src/User/resources/views/shared/message.php
rename to src/User/resources/views/bootstrap3/shared/message.php
diff --git a/src/User/resources/views/bootstrap3/widgets/assignments/form.php b/src/User/resources/views/bootstrap3/widgets/assignments/form.php
new file mode 100644
index 00000000..0fa55a03
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/widgets/assignments/form.php
@@ -0,0 +1,59 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use dosamigos\selectize\SelectizeDropDownList;
+use yii\bootstrap\Alert;
+use yii\helpers\Html;
+use yii\widgets\ActiveForm;
+
+/** @var \yii\web\View $this */
+/** @var string[] $availableItems */
+/** @var Da\User\Model\Assignment $model */
+
+
+?>
+
+updated): ?>
+
+ = Alert::widget(
+ [
+ 'options' => [
+ 'class' => 'alert-success',
+ ],
+ 'body' => Yii::t('usuario', 'Assignments have been updated'),
+ ]
+ ) ?>
+
+
+
+ false,
+ 'enableAjaxValidation' => false,
+ ]
+) ?>
+
+= Html::activeHiddenInput($model, 'user_id') ?>
+
+= $form->field($model, 'items')->widget(
+ SelectizeDropDownList::class,
+ [
+ 'items' => $availableItems,
+ 'options' => [
+ 'id' => 'children',
+ 'multiple' => true,
+ ],
+ ]
+) ?>
+
+= Html::submitButton(Yii::t('usuario', 'Update assignments'), ['class' => 'btn btn-success btn-block']) ?>
+
+
diff --git a/src/User/resources/views/bootstrap3/widgets/login/form.php b/src/User/resources/views/bootstrap3/widgets/login/form.php
new file mode 100644
index 00000000..90032da9
--- /dev/null
+++ b/src/User/resources/views/bootstrap3/widgets/login/form.php
@@ -0,0 +1,56 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+use yii\helpers\Html;
+use yii\helpers\Url;
+use yii\widgets\ActiveForm;
+
+/**
+ * @var yii\web\View $this
+ * @var yii\widgets\ActiveForm $form
+ * @var Da\User\Form\LoginForm $model
+ * @var string $action
+ */
+
+?>
+
+user->isGuest): ?>
+ 'login-widget-form',
+ 'action' => Url::to(['/user/security/login']),
+ 'enableAjaxValidation' => true,
+ 'enableClientValidation' => false,
+ 'validateOnBlur' => false,
+ 'validateOnType' => false,
+ 'validateOnChange' => false,
+ ]
+ ) ?>
+
+ = $form->field($model, 'login')->textInput(['placeholder' => Yii::t('usuario', 'Login')]) ?>
+
+ = $form->field($model, 'password')->passwordInput(['placeholder' => Yii::t('usuario', 'Password')]) ?>
+
+ = $form->field($model, 'rememberMe')->checkbox() ?>
+
+ = Html::submitButton(Yii::t('usuario', 'Sign in'), ['class' => 'btn btn-primary btn-block']) ?>
+
+
+
+ = Html::a(
+ Yii::t('usuario', 'Logout'),
+ ['/user/security/logout'],
+ [
+ 'class' => 'btn btn-danger btn-block',
+ 'data-method' => 'post',
+ ]
+ ) ?>
+
diff --git a/src/User/resources/views/admin/_account.php b/src/User/resources/views/bootstrap5/admin/_account.php
similarity index 100%
rename from src/User/resources/views/admin/_account.php
rename to src/User/resources/views/bootstrap5/admin/_account.php
diff --git a/src/User/resources/views/admin/_assignments.php b/src/User/resources/views/bootstrap5/admin/_assignments.php
similarity index 100%
rename from src/User/resources/views/admin/_assignments.php
rename to src/User/resources/views/bootstrap5/admin/_assignments.php
diff --git a/src/User/resources/views/bootstrap5/admin/_info.php b/src/User/resources/views/bootstrap5/admin/_info.php
new file mode 100644
index 00000000..a2de1439
--- /dev/null
+++ b/src/User/resources/views/bootstrap5/admin/_info.php
@@ -0,0 +1,58 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+/** @var yii\web\View $this */
+/** @var Da\User\Model\User $user */
+/** @var \Da\User\Module $module */
+
+?>
+
+beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?>
+
+
+
+ = Yii::t('usuario', 'Registration time') ?>:
+ = Yii::t('usuario', '{0, date, MMMM dd, YYYY HH:mm}', [$user->created_at]) ?>
+
+ registration_ip !== null): ?>
+
+ = Yii::t('usuario', 'Registration IP') ?>:
+ = $user->registration_ip ?>
+
+
+
+ = Yii::t('usuario', 'Confirmation status') ?>:
+ isConfirmed): ?>
+ = Yii::t(
+ 'usuario',
+ 'Confirmed at {0, date, MMMM dd, YYYY HH:mm}',
+ [$user->confirmed_at]
+ ) ?>
+
+ = Yii::t('usuario', 'Unconfirmed') ?>
+
+
+
+ = Yii::t('usuario', 'Block status') ?>:
+ isBlocked): ?>
+ = Yii::t(
+ 'usuario',
+ 'Blocked at {0, date, MMMM dd, YYYY HH:mm}',
+ [$user->blocked_at]
+ ) ?>
+
+
+ = Yii::t('usuario', 'Not blocked') ?>
+
+
+
+
+endContent() ?>
diff --git a/src/User/resources/views/admin/_profile.php b/src/User/resources/views/bootstrap5/admin/_profile.php
similarity index 100%
rename from src/User/resources/views/admin/_profile.php
rename to src/User/resources/views/bootstrap5/admin/_profile.php
diff --git a/src/User/resources/views/admin/_session-history.php b/src/User/resources/views/bootstrap5/admin/_session-history.php
similarity index 98%
rename from src/User/resources/views/admin/_session-history.php
rename to src/User/resources/views/bootstrap5/admin/_session-history.php
index c86f647b..ac0c96cd 100755
--- a/src/User/resources/views/admin/_session-history.php
+++ b/src/User/resources/views/bootstrap5/admin/_session-history.php
@@ -29,7 +29,7 @@
beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?>
-
+
= Html::a(
Yii::t('usuario', 'Terminate all sessions'),
['/user/admin/terminate-sessions', 'id' => $user->id],
diff --git a/src/User/resources/views/bootstrap5/admin/_user.php b/src/User/resources/views/bootstrap5/admin/_user.php
new file mode 100644
index 00000000..5e7303e5
--- /dev/null
+++ b/src/User/resources/views/bootstrap5/admin/_user.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+/**
+ * @var yii\widgets\ActiveForm $form
+ * @var \Da\User\Model\User $user
+ */
+?>
+
+= $form->field($user, 'email')->textInput(['maxlength' => 255]) ?>
+= $form->field($user, 'username')->textInput(['maxlength' => 255]) ?>
+= $form->field($user, 'password')->passwordInput() ?>
diff --git a/src/User/resources/views/admin/create.php b/src/User/resources/views/bootstrap5/admin/create.php
similarity index 99%
rename from src/User/resources/views/admin/create.php
rename to src/User/resources/views/bootstrap5/admin/create.php
index 16b61f2c..43d980f1 100644
--- a/src/User/resources/views/admin/create.php
+++ b/src/User/resources/views/bootstrap5/admin/create.php
@@ -32,7 +32,7 @@
) ?>