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', + ], + ], + ] +); ?> + +render('/admin/_user', ['form' => $form, 'user' => $user]) ?> + +
+
+ 'btn btn-block btn-success']) ?> +
+
+ + + +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]) ?> + + [ + 'class' => 'alert-info alert-dismissible', + ], + 'body' => Yii::t('usuario', 'You can assign multiple roles or permissions to user by using the form below'), + ] +) ?> + + $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', + ], + ], + ] +); ?> + +field($profile, 'name') ?> +field($profile, 'public_email') ?> +field($profile, 'website') ?> +field($profile, 'location') ?> +field($profile, 'gravatar_email') ?> +field($profile, 'bio')->textarea() ?> + + +
+
+ 'btn btn-block btn-success']) ?> +
+
+ + + +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]) ?> +
+
+ $user->id], + [ + 'class' => 'btn btn-danger btn-xs pull-right', + 'data-method' => 'post' + ] + ) ?> +
+
+
+ + + + $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; + +?> +
+render( + '/shared/_alert', + [ + 'module' => Yii::$app->getModule('user'), + ] +) ?> + +
+
+
+
+

title) ?>

+
+
+ render('/shared/_menu') ?> +
+
+
+
+ [ + '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;', + ], + ], + ], + ] + ) ?> +
+
+
+
+
+
+
+ . + . +
+ 'horizontal', + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + 'fieldConfig' => [ + 'horizontalCssClasses' => [ + 'wrapper' => 'col-sm-9', + ], + ], + ] + ); ?> + + render('/admin/_user', ['form' => $form, 'user' => $user]) ?> + +
+
+ 'btn btn-block btn-success'] + ) ?> +
+
+ + +
+
+
+
+
+
+
+
+ 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') ?> + + +
+ $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'); +?> +
+render( + '/shared/_alert', + [ + 'module' => $module, + ] +) ?> + +
+
+
+
+

title) ?>

+
+
+ render('/shared/_menu') ?> +
+
+
+
+ [ + '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, + ] +) ?> + +field($model, 'name') ?> + +field($model, 'description') ?> + +field($model, 'rule')->widget(SelectizeDropDownList::class, [ + 'items' => ArrayHelper::map(Yii::$app->getAuthManager()->getRules(), 'name', 'name'), + 'options' => [ + 'prompt' => Yii::t('usuario', 'Select rule...'), + ] +]) ?> + + +field($model, 'children')->widget( + SelectizeDropDownList::class, + [ + 'items' => $unassignedItems, + 'options' => [ + 'id' => 'children', + 'multiple' => true, + ], + ] +) ?> + + '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; +?> +
+
+
+
+ getAvatarUrl(230), + [ + 'class' => 'img-rounded img-responsive', + 'alt' => $profile->user->username, + ] + ) ?> +
+
+

title ?>

+
    + location)): ?> +
  • + + location) ?> +
  • + + website)): ?> +
  • + + website), Html::encode($profile->website)) ?> +
  • + + public_email)): ?> +
  • + + public_email), + 'mailto:' . + Html::encode($profile->public_email) + ) + ?> +
  • + +
  • + + user->created_at) ?> +
  • +
+ bio)): ?> +

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; +?> +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + ] + ); ?> + + field($model, 'email')->textInput(['autofocus' => true]) ?> + + '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; +?> +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + ] + ); ?> + + field($model, 'password')->passwordInput() ?> + + '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; +?> +
+
+
+
+

title) ?>

+
+
+
+

+ : +

+
+ $model->formName(), + ] + ); ?> + + field($model, 'email') ?> + + field($model, 'username') ?> + + 'btn btn-success btn-block']) ?> + + +
+
+

+ . +

+
+
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; +?> +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + ] + ); ?> + + field($model, 'email')->textInput(['autofocus' => true]) ?> + + field($model, 'username') ?> + + generatePasswords === false): ?> + field($model, 'password')->passwordInput() ?> + + + enableGdprCompliance): ?> + field($model, 'gdpr_consent')->checkbox(['value' => 1]) ?> + + + 'btn btn-success btn-block']) ?> + + +
+
+

+ +

+
+
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; +?> +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + ] + ); ?> + + field($model, 'email')->textInput(['autofocus' => true]) ?> + + '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, + ] +) ?> + +field($model, 'name') ?> + +field($model, 'description') ?> + +field($model, 'rule')->widget(SelectizeDropDownList::class, [ + 'items' => ArrayHelper::map(Yii::$app->getAuthManager()->getRules(), 'name', 'name'), + 'options' => [ + 'prompt' => 'Select rule...' + ] +]) ?> + +field($model, 'children')->widget( + SelectizeDropDownList::class, + [ + 'items' => $unassignedItems, + 'options' => [ + 'id' => 'children', + 'multiple' => true, + ], + ] +) ?> + + '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, + ] +) ?> + +field($model, 'name') ?> + +field($model, 'className') ?> + + '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; +?> + +render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> + +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + 'validateOnBlur' => false, + 'validateOnType' => false, + 'validateOnChange' => false, + ] + ) ?> + field( + $model, + 'twoFactorAuthenticationCode', + ['inputOptions' => ['autofocus' => 'autofocus', 'class' => 'form-control', 'tabindex' => '1']] + ) ?> +
+
+ 'btn btn-default btn-block', 'tabindex' => '3'] + ) ?> +
+
+ '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; +?> + +render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> + +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + 'validateOnBlur' => false, + 'validateOnType' => false, + 'validateOnChange' => false, + ] + ) ?> + + field( + $model, + 'login', + ['inputOptions' => ['autofocus' => 'autofocus', 'class' => 'form-control', 'tabindex' => '1']] + ) ?> + + 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'] + ) + . ')' : '') + ) ?> + + field($model, 'rememberMe')->checkbox(['tabindex' => '4']) ?> + + 'btn btn-primary btn-block', 'tabindex' => '3'] + ) ?> + + +
+
+ enableEmailConfirmation): ?> +

+ +

+ + enableRegistration): ?> +

+ +

+ + ['/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; + +?> + +
+
+

+ profile->getAvatarUrl(24), + [ + 'class' => 'img-rounded', + 'alt' => $user->username, + ] + ) ?> + username ?> +

+
+
+ [ + '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'); +?> +
+ +render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> + +
+
+ render('/settings/_menu') ?> +
+
+
+
+

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, + ] + ); ?> + + field($model, 'email') ?> + + field($model, 'username') ?> + + field($model, 'new_password')->passwordInput() ?> + +
+ + field($model, 'current_password')->passwordInput() ?> + +
+
+ 'btn btn-block btn-success']) ?> +
+
+
+ + +
+
+ enableTwoFactorAuthentication): ?> + +
+
+

+
+
+

+ . +

+ 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" ]; + ?> +
+ > + +
+ + '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; + } + ?> + +

+
+ $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): ?> +
+
+

+
+
+

+ . + . + . +

+
+ '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(), + ] + ); ?> + + + +
+
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 */ +?> + +
+
+
+
+

+ +

+
+
+

+

+ +

+
+ +
+
+ field($model, 'password')->passwordInput() ?> +
+
+
+
+ 'btn btn-danger']) ?> +
+
+
+
+
+ '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; +?> + +
+ +render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> + +
+
+ render('/settings/_menu') ?> +
+
+
+
+ title) ?> +
+
+
+

+ .

+
+ ['/user/security/auth'], + 'accounts' => $user->socialNetworkAccounts, + 'autoRender' => false, + 'popupMode' => false, + ] + ) ?> + + getClients() as $client): ?> + + + + + + +
+ 'auth-icon ' . $client->getName()]) ?> + + getTitle() ?> + + 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'); + +?> + +
+
+ render('_menu') ?> +
+
+
+
+

title) ?>

+
+
+
+
+

+

+

+ 'btn btn-info', + 'target' => '_blank' + ]) + ?> +
+
+

+

+

+ allowAccountDelete): ?> + '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); +?> + +
+ +render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> + +
+
+ render('_menu') ?> +
+
+
+
+

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, + ] + ); ?> + + field($model, 'name') ?> + + field($model, 'public_email') ?> + + field($model, 'website') ?> + + field($model, 'location') ?> + + field($model, 'timezone') + ->dropDownList(ArrayHelper::map($timezoneHelper->getAll(), 'timezone', 'name')); + ?> + field($model, 'gravatar_email') + ->hint( + Html::a( + Yii::t('usuario', 'Change your avatar at Gravatar.com'), + 'http://gravatar.com', + ['target' => '_blank'] + ) + ) ?> + + field($model, 'bio')->textarea() ?> + +
+
+ 'btn btn-block btn-success']) ?> +
+
+
+ + +
+
+
+
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; +?> + +render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> + +
+
+ render('/settings/_menu') ?> +
+
+
+
+ title) ?> + 'btn btn-danger btn-xs pull-right', + 'data-method' => 'post' + ] + ) ?> +
+
+ + + + $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): ?> + + ['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; + +?> + + [ + '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 */ + +?> +
+ +render( + '/shared/_alert', + [ + 'module' => Yii::$app->getModule('user'), + ] +) ?> + +
+
+
+
+

title) ?>

+
+
+ render('/shared/_menu') ?> + +
+
+
+
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): ?> + + [ + 'class' => 'alert-success', + ], + 'body' => Yii::t('usuario', 'Assignments have been updated'), + ] + ) ?> + + + + false, + 'enableAjaxValidation' => false, + ] +) ?> + + + +field($model, 'items')->widget( + SelectizeDropDownList::class, + [ + 'items' => $availableItems, + 'options' => [ + 'id' => 'children', + 'multiple' => true, + ], + ] +) ?> + + '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, + ] + ) ?> + + field($model, 'login')->textInput(['placeholder' => Yii::t('usuario', 'Login')]) ?> + + field($model, 'password')->passwordInput(['placeholder' => Yii::t('usuario', 'Password')]) ?> + + field($model, 'rememberMe')->checkbox() ?> + + 'btn btn-primary btn-block']) ?> + + + + '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]) ?> + + + + + + + registration_ip !== null): ?> + + + + + + + + isConfirmed): ?> + + + + + + + + isBlocked): ?> + + + + + +
:created_at]) ?>
:registration_ip ?>
:confirmed_at] + ) ?>
:blocked_at] + ) ?> +
+ +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]) ?>
-
+
$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 + */ +?> + +field($user, 'email')->textInput(['maxlength' => 255]) ?> +field($user, 'username')->textInput(['maxlength' => 255]) ?> +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 @@ ) ?>
-
+

title) ?>

diff --git a/src/User/resources/views/admin/index.php b/src/User/resources/views/bootstrap5/admin/index.php similarity index 100% rename from src/User/resources/views/admin/index.php rename to src/User/resources/views/bootstrap5/admin/index.php diff --git a/src/User/resources/views/admin/update.php b/src/User/resources/views/bootstrap5/admin/update.php similarity index 100% rename from src/User/resources/views/admin/update.php rename to src/User/resources/views/bootstrap5/admin/update.php diff --git a/src/User/resources/views/permission/_form.php b/src/User/resources/views/bootstrap5/permission/_form.php similarity index 100% rename from src/User/resources/views/permission/_form.php rename to src/User/resources/views/bootstrap5/permission/_form.php diff --git a/src/User/resources/views/bootstrap5/permission/create.php b/src/User/resources/views/bootstrap5/permission/create.php new file mode 100644 index 00000000..8cc02365 --- /dev/null +++ b/src/User/resources/views/bootstrap5/permission/create.php @@ -0,0 +1,34 @@ + + * + * 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\Permission $model + * @var string[] $unassignedItems + * @var \Da\User\Module $module + */ + +$this->title = Yii::t('usuario', 'Create new permission'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> + +render( + '/permission/_form', + [ + 'model' => $model, + 'unassignedItems' => $unassignedItems, + ] +) ?> + +endContent() ?> diff --git a/src/User/resources/views/bootstrap5/permission/index.php b/src/User/resources/views/bootstrap5/permission/index.php new file mode 100644 index 00000000..65142bf9 --- /dev/null +++ b/src/User/resources/views/bootstrap5/permission/index.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var \yii\data\ActiveDataProvider $dataProvider + * @var yii\web\View $this + * @var \Da\User\Search\PermissionSearch $searchModel + * @var \Da\User\Module $module + */ +use yii\grid\ActionColumn; +use yii\grid\GridView; +use yii\helpers\Url; + +$this->title = Yii::t('usuario', 'Permissions'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> +
+ $dataProvider, + 'filterModel' => $searchModel, + 'layout' => "{items}\n{pager}", + 'columns' => [ + [ + 'attribute' => 'name', + 'header' => Yii::t('usuario', 'Name'), + 'options' => [ + 'style' => 'width: 20%', + ], + ], + [ + 'attribute' => 'description', + 'header' => Yii::t('usuario', 'Description'), + 'options' => [ + 'style' => 'width: 55%', + ], + ], + [ + 'attribute' => 'rule_name', + 'header' => Yii::t('usuario', 'Rule name'), + 'options' => [ + 'style' => 'width: 20%', + ], + ], + [ + 'class' => ActionColumn::class, + 'template' => '{update} {delete}', + 'urlCreator' => function ($action, $model) { + return Url::to(['/user/permission/' . $action, 'name' => $model['name']]); + }, + 'options' => [ + 'style' => 'width: 5%', + ], + ], + ], + ] +) ?> +
+endContent() ?> diff --git a/src/User/resources/views/bootstrap5/permission/update.php b/src/User/resources/views/bootstrap5/permission/update.php new file mode 100644 index 00000000..7b1ab449 --- /dev/null +++ b/src/User/resources/views/bootstrap5/permission/update.php @@ -0,0 +1,34 @@ + + * + * 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\Permission $model + * @var string[] $unassignedItems + * @var \Da\User\Module $module + */ + +$this->title = Yii::t('usuario', 'Update permission'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> + +render( + '/permission/_form', + [ + 'model' => $model, + 'unassignedItems' => $unassignedItems, + ] +) ?> + +endContent() ?> diff --git a/src/User/resources/views/profile/show.php b/src/User/resources/views/bootstrap5/profile/show.php similarity index 100% rename from src/User/resources/views/profile/show.php rename to src/User/resources/views/bootstrap5/profile/show.php diff --git a/src/User/resources/views/recovery/request.php b/src/User/resources/views/bootstrap5/recovery/request.php similarity index 91% rename from src/User/resources/views/recovery/request.php rename to src/User/resources/views/bootstrap5/recovery/request.php index 0082377c..8d4341bb 100644 --- a/src/User/resources/views/recovery/request.php +++ b/src/User/resources/views/bootstrap5/recovery/request.php @@ -22,7 +22,9 @@ $this->params['breadcrumbs'][] = $this->title; ?>
-
+
+ +

title) ?>

@@ -44,4 +46,5 @@
+
diff --git a/src/User/resources/views/recovery/reset.php b/src/User/resources/views/bootstrap5/recovery/reset.php similarity index 100% rename from src/User/resources/views/recovery/reset.php rename to src/User/resources/views/bootstrap5/recovery/reset.php diff --git a/src/User/resources/views/registration/connect.php b/src/User/resources/views/bootstrap5/registration/connect.php similarity index 100% rename from src/User/resources/views/registration/connect.php rename to src/User/resources/views/bootstrap5/registration/connect.php diff --git a/src/User/resources/views/registration/register.php b/src/User/resources/views/bootstrap5/registration/register.php similarity index 94% rename from src/User/resources/views/registration/register.php rename to src/User/resources/views/bootstrap5/registration/register.php index 4c89e9f0..8c9a05d4 100644 --- a/src/User/resources/views/registration/register.php +++ b/src/User/resources/views/bootstrap5/registration/register.php @@ -23,7 +23,9 @@ $this->params['breadcrumbs'][] = $this->title; ?>
-
+
+ +

title) ?>

@@ -58,4 +60,6 @@

+
+
diff --git a/src/User/resources/views/registration/resend.php b/src/User/resources/views/bootstrap5/registration/resend.php similarity index 91% rename from src/User/resources/views/registration/resend.php rename to src/User/resources/views/bootstrap5/registration/resend.php index d25f392d..6a4b4d99 100644 --- a/src/User/resources/views/registration/resend.php +++ b/src/User/resources/views/bootstrap5/registration/resend.php @@ -21,7 +21,8 @@ $this->params['breadcrumbs'][] = $this->title; ?>
-
+
+

title) ?>

@@ -43,4 +44,5 @@
+
diff --git a/src/User/resources/views/role/_form.php b/src/User/resources/views/bootstrap5/role/_form.php similarity index 100% rename from src/User/resources/views/role/_form.php rename to src/User/resources/views/bootstrap5/role/_form.php diff --git a/src/User/resources/views/bootstrap5/role/create.php b/src/User/resources/views/bootstrap5/role/create.php new file mode 100644 index 00000000..a8210366 --- /dev/null +++ b/src/User/resources/views/bootstrap5/role/create.php @@ -0,0 +1,33 @@ + + * + * 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 + * @var string[] $unassignedItems + * @var \Da\User\Module $module + */ +$this->title = Yii::t('usuario', 'Create new role'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> + +render( + '/role/_form', + [ + 'model' => $model, + 'unassignedItems' => $unassignedItems, + ] +) ?> + +endContent() ?> diff --git a/src/User/resources/views/bootstrap5/role/index.php b/src/User/resources/views/bootstrap5/role/index.php new file mode 100644 index 00000000..5a7beb63 --- /dev/null +++ b/src/User/resources/views/bootstrap5/role/index.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\grid\ActionColumn; +use yii\grid\GridView; +use yii\helpers\Url; + +/** + * @var \yii\data\DataProviderInterface $dataProvider + * @var \Da\User\Search\RoleSearch $searchModel + * @var yii\web\View $this + * @var \Da\User\Module $module + */ + +$this->title = Yii::t('usuario', 'Roles'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> +
+ $dataProvider, + 'filterModel' => $searchModel, + 'layout' => "{items}\n{pager}", + 'columns' => [ + [ + 'attribute' => 'name', + 'header' => Yii::t('usuario', 'Name'), + 'options' => [ + 'style' => 'width: 20%', + ], + ], + [ + 'attribute' => 'description', + 'header' => Yii::t('usuario', 'Description'), + 'options' => [ + 'style' => 'width: 55%', + ], + ], + [ + 'attribute' => 'rule_name', + 'header' => Yii::t('usuario', 'Rule name'), + 'options' => [ + 'style' => 'width: 20%', + ], + ], + [ + 'class' => ActionColumn::class, + 'template' => '{update} {delete}', + 'urlCreator' => function ($action, $model) { + return Url::to(['/user/role/' . $action, 'name' => $model['name']]); + }, + 'options' => [ + 'style' => 'width: 5%', + ], + ], + ], + ] +) ?> +
+endContent() ?> diff --git a/src/User/resources/views/bootstrap5/role/update.php b/src/User/resources/views/bootstrap5/role/update.php new file mode 100644 index 00000000..b5121c96 --- /dev/null +++ b/src/User/resources/views/bootstrap5/role/update.php @@ -0,0 +1,33 @@ + + * + * 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 + * @var string[] $unassignedItems + * @var \Da\User\Module $module + */ +$this->title = Yii::t('usuario', 'Update role'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> + +render( + '/role/_form', + [ + 'model' => $model, + 'unassignedItems' => $unassignedItems, + ] +) ?> + +endContent() ?> diff --git a/src/User/resources/views/rule/_form.php b/src/User/resources/views/bootstrap5/rule/_form.php similarity index 100% rename from src/User/resources/views/rule/_form.php rename to src/User/resources/views/bootstrap5/rule/_form.php diff --git a/src/User/resources/views/bootstrap5/rule/create.php b/src/User/resources/views/bootstrap5/rule/create.php new file mode 100644 index 00000000..a03f96c5 --- /dev/null +++ b/src/User/resources/views/bootstrap5/rule/create.php @@ -0,0 +1,32 @@ + + * + * 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\Rule $model + * @var string[] $unassignedItems + * @var \Da\User\Module $module + */ +$this->title = Yii::t('usuario', 'Create new rule'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> + +render( + '/rule/_form', + [ + 'model' => $model, + ] +) ?> + +endContent() ?> diff --git a/src/User/resources/views/bootstrap5/rule/index.php b/src/User/resources/views/bootstrap5/rule/index.php new file mode 100644 index 00000000..b2fd066a --- /dev/null +++ b/src/User/resources/views/bootstrap5/rule/index.php @@ -0,0 +1,78 @@ +title = Yii::t('usuario', 'Rules'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> +
+ $dataProvider, + 'filterModel' => $searchModel, + 'layout' => "{items}\n{pager}", + 'columns' => [ + [ + 'attribute' => 'name', + 'label' => Yii::t('usuario', 'Name'), + 'options' => [ + 'style' => 'width: 20%' + ], + ], + [ + 'attribute' => 'className', + 'label' => Yii::t('usuario', 'Class'), + 'value' => function ($row) { + $rule = unserialize($row['data']); + + return get_class($rule); + }, + 'options' => [ + 'style' => 'width: 20%' + ], + ], + [ + 'attribute' => 'created_at', + 'label' => Yii::t('usuario', 'Created at'), + 'format' => 'datetime', + 'options' => [ + 'style' => 'width: 20%' + ], + ], + [ + 'attribute' => 'updated_at', + 'label' => Yii::t('usuario', 'Updated at'), + 'format' => 'datetime', + 'options' => [ + 'style' => 'width: 20%' + ], + ], + [ + 'class' => ActionColumn::class, + 'template' => '{update} {delete}', + 'urlCreator' => function ($action, $model) { + return Url::to(['/user/rule/' . $action, 'name' => $model['name']]); + }, + 'options' => [ + 'style' => 'width: 5%' + ], + ] + ], + ] +) ?> +
+ +endContent() ?> diff --git a/src/User/resources/views/bootstrap5/rule/update.php b/src/User/resources/views/bootstrap5/rule/update.php new file mode 100644 index 00000000..53e086a0 --- /dev/null +++ b/src/User/resources/views/bootstrap5/rule/update.php @@ -0,0 +1,34 @@ + + * + * 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\Rule $model + * @var string[] $unassignedItems + * @var \Da\User\Module $module + */ + +$this->title = Yii::t('usuario', 'Update rule'); +$this->params['breadcrumbs'][] = ['label' => Yii::t('usuario', 'Rules'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> + +render( + '/rule/_form', + [ + 'model' => $model, + ] +) ?> + +endContent() ?> diff --git a/src/User/resources/views/security/confirm.php b/src/User/resources/views/bootstrap5/security/confirm.php similarity index 93% rename from src/User/resources/views/security/confirm.php rename to src/User/resources/views/bootstrap5/security/confirm.php index 728d2b9c..73fb81b5 100644 --- a/src/User/resources/views/security/confirm.php +++ b/src/User/resources/views/bootstrap5/security/confirm.php @@ -25,8 +25,9 @@ render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> -
-
+
+
+

title) ?>

@@ -66,4 +67,6 @@
+
+
diff --git a/src/User/resources/views/security/login.php b/src/User/resources/views/bootstrap5/security/login.php similarity index 95% rename from src/User/resources/views/security/login.php rename to src/User/resources/views/bootstrap5/security/login.php index db7d3360..1cf36588 100644 --- a/src/User/resources/views/security/login.php +++ b/src/User/resources/views/bootstrap5/security/login.php @@ -25,8 +25,9 @@ render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> -
-
+
+
+

title) ?>

@@ -96,4 +97,5 @@ ] ) ?>
+
diff --git a/src/User/resources/views/settings/_menu.php b/src/User/resources/views/bootstrap5/settings/_menu.php similarity index 100% rename from src/User/resources/views/settings/_menu.php rename to src/User/resources/views/bootstrap5/settings/_menu.php diff --git a/src/User/resources/views/settings/account.php b/src/User/resources/views/bootstrap5/settings/account.php similarity index 98% rename from src/User/resources/views/settings/account.php rename to src/User/resources/views/bootstrap5/settings/account.php index b2fba0dd..86b687df 100644 --- a/src/User/resources/views/settings/account.php +++ b/src/User/resources/views/bootstrap5/settings/account.php @@ -14,7 +14,6 @@ use yii\helpers\Url; use yii\bootstrap5\ActiveForm; use dmstr\widgets\Alert; - /** * @var yii\web\View $this * @var yii\widgets\ActiveForm $form @@ -79,7 +78,7 @@ enableTwoFactorAuthentication): ?> -
+

@@ -141,7 +140,7 @@ break; } ?> - +

+* +* For the full copyright and license information, please view +* the LICENSE file that was distributed with this source code. +*/ + +/** @var string $id */ +/** @var string $uri */ +?> + +
+

+ +

+
+ +
+
+
+ + + + +
+
+
diff --git a/src/User/resources/views/bootstrap5/settings/two-factor-sms.php b/src/User/resources/views/bootstrap5/settings/two-factor-sms.php new file mode 100644 index 00000000..ce033c9a --- /dev/null +++ b/src/User/resources/views/bootstrap5/settings/two-factor-sms.php @@ -0,0 +1,68 @@ + +* +* For the full copyright and license information, please view +* the LICENSE file that was distributed with this source code. +*/ + +/** @var string $id */ +/** @var string $uri */ +/** @var string $mobilePhone */ +?> + +
+
+

+ +

+
+ +
+
+
+ + + + +
+
+
+
+ +
+
+
+

+ +

+
+ +
+
+
+
+
+
+
+
+ + + + +
+
+
+
\ No newline at end of file diff --git a/src/User/resources/views/bootstrap5/settings/two-factor.php b/src/User/resources/views/bootstrap5/settings/two-factor.php new file mode 100644 index 00000000..439b82e0 --- /dev/null +++ b/src/User/resources/views/bootstrap5/settings/two-factor.php @@ -0,0 +1,47 @@ + +* +* For the full copyright and license information, please view +* the LICENSE file that was distributed with this source code. +*/ + +/** @var string $id */ +/** @var string $uri */ +/** @var Da\User\Model\User $user */ +?> + +
+

+ +

+
+ +
+
+ +
+
+
+
+ +
auth_tf_key ?>
+
+
+
+
+
+ + + + +
+
+
diff --git a/src/User/resources/views/shared/_alert.php b/src/User/resources/views/bootstrap5/shared/_alert.php similarity index 100% rename from src/User/resources/views/shared/_alert.php rename to src/User/resources/views/bootstrap5/shared/_alert.php diff --git a/src/User/resources/views/shared/_menu.php b/src/User/resources/views/bootstrap5/shared/_menu.php similarity index 100% rename from src/User/resources/views/shared/_menu.php rename to src/User/resources/views/bootstrap5/shared/_menu.php diff --git a/src/User/resources/views/shared/admin_layout.php b/src/User/resources/views/bootstrap5/shared/admin_layout.php similarity index 100% rename from src/User/resources/views/shared/admin_layout.php rename to src/User/resources/views/bootstrap5/shared/admin_layout.php diff --git a/src/User/resources/views/bootstrap5/shared/message.php b/src/User/resources/views/bootstrap5/shared/message.php new file mode 100644 index 00000000..8cb23e62 --- /dev/null +++ b/src/User/resources/views/bootstrap5/shared/message.php @@ -0,0 +1,27 @@ + + * + * 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 string $content */ +/** @var string $title */ +/** @var \Da\User\Module $module */ + + +$this->title = $title; + +?> + +render( + '/shared/_alert', + [ + 'module' => $module, + ] +); diff --git a/src/User/resources/views/widgets/assignments/form.php b/src/User/resources/views/bootstrap5/widgets/assignments/form.php similarity index 100% rename from src/User/resources/views/widgets/assignments/form.php rename to src/User/resources/views/bootstrap5/widgets/assignments/form.php diff --git a/src/User/resources/views/widgets/login/form.php b/src/User/resources/views/bootstrap5/widgets/login/form.php similarity index 100% rename from src/User/resources/views/widgets/login/form.php rename to src/User/resources/views/bootstrap5/widgets/login/form.php