Removed SettingsController and moved its logic into ProfileController, consolidating user profile, account, GDPR, network, and two-factor authentication actions. Updated routes, behaviors, and view files to reflect the new structure. Also updated composer.json to use pcrt/yii2-usuario and pcrt/yii2-select2, added 'surname' to Profile model, and added new attributes to User model. Improved user feedback by redirecting after key actions instead of rendering message views.
139 lines
6.5 KiB
PHP
Executable File
139 lines
6.5 KiB
PHP
Executable File
<?php
|
|
|
|
/*
|
|
* This file is part of the 2amigos/yii2-usuario project.
|
|
*
|
|
* (c) 2amigOS! <http://2amigos.us/>
|
|
*
|
|
* 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\bootstrap4\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');
|
|
?>
|
|
<div class="clearfix"></div>
|
|
<?= $this->render(
|
|
'/shared/_alert',
|
|
[
|
|
'module' => $module,
|
|
]
|
|
) ?>
|
|
|
|
<div class="container-fluid px-0">
|
|
<div class="tab-wrapper">
|
|
<?= $this->render('/shared/_menu') ?>
|
|
<div class="row p-3">
|
|
<div class="col-12 col-md-4 col-lg-3">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<?= Nav::widget([
|
|
'options' => [
|
|
'class' => 'nav nav-pills flex-column',
|
|
],
|
|
'items' => [
|
|
[
|
|
'label' => Yii::t('usuario', 'Account details'),
|
|
'url' => ['/user/admin/update', 'id' => $user->id],
|
|
'linkOptions' => ['class' => 'nav-link'],
|
|
'options' => ['class' => 'nav-item'],
|
|
],
|
|
[
|
|
'label' => Yii::t('usuario', 'Profile details'),
|
|
'url' => ['/user/admin/update-profile', 'id' => $user->id],
|
|
'linkOptions' => ['class' => 'nav-link'],
|
|
'options' => ['class' => 'nav-item'],
|
|
],
|
|
[
|
|
'label' => Yii::t('usuario', 'Information'),
|
|
'url' => ['/user/admin/info', 'id' => $user->id],
|
|
'linkOptions' => ['class' => 'nav-link'],
|
|
'options' => ['class' => 'nav-item'],
|
|
],
|
|
[
|
|
'label' => Yii::t('usuario', 'Assignments'),
|
|
'url' => ['/user/admin/assignments', 'id' => $user->id],
|
|
'linkOptions' => ['class' => 'nav-link'],
|
|
'options' => ['class' => 'nav-item'],
|
|
],
|
|
[
|
|
'label' => Yii::t('usuario', 'Session history'),
|
|
'url' => ['/user/admin/session-history', 'id' => $user->id],
|
|
'visible' => $module->enableSessionHistory,
|
|
'linkOptions' => ['class' => 'nav-link'],
|
|
'options' => ['class' => 'nav-item'],
|
|
],
|
|
[
|
|
'label' => Yii::t('usuario', 'Confirm'),
|
|
'url' => ['/user/admin/confirm', 'id' => $user->id],
|
|
'visible' => !$user->isConfirmed,
|
|
'linkOptions' => [
|
|
'class' => 'nav-link text-success',
|
|
'data-method' => 'post',
|
|
'data-confirm' => Yii::t('usuario', 'Are you sure you want to confirm this user?'),
|
|
],
|
|
'options' => ['class' => 'nav-item'],
|
|
],
|
|
[
|
|
'label' => Yii::t('usuario', 'Block'),
|
|
'url' => ['/user/admin/block', 'id' => $user->id],
|
|
'visible' => !$user->isBlocked,
|
|
'linkOptions' => [
|
|
'class' => 'nav-link text-danger',
|
|
'data-method' => 'post',
|
|
'data-confirm' => Yii::t('usuario', 'Are you sure you want to block this user?'),
|
|
],
|
|
'options' => ['class' => 'nav-item'],
|
|
],
|
|
[
|
|
'label' => Yii::t('usuario', 'Unblock'),
|
|
'url' => ['/user/admin/block', 'id' => $user->id],
|
|
'visible' => $user->isBlocked,
|
|
'linkOptions' => [
|
|
'class' => 'nav-link text-success',
|
|
'data-method' => 'post',
|
|
'data-confirm' => Yii::t('usuario', 'Are you sure you want to unblock this user?'),
|
|
],
|
|
'options' => ['class' => 'nav-item'],
|
|
],
|
|
[
|
|
'label' => Yii::t('usuario', 'Delete'),
|
|
'url' => ['/user/admin/delete', 'id' => $user->id],
|
|
'linkOptions' => [
|
|
'class' => 'nav-link text-danger',
|
|
'data-method' => 'post',
|
|
'data-confirm' => Yii::t('usuario', 'Are you sure you want to delete this user?'),
|
|
],
|
|
'options' => ['class' => 'nav-item'],
|
|
],
|
|
],
|
|
]) ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-md-8 col-lg-9">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<?= $content ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|