Permissions sur le bouton mon compte

This commit is contained in:
Fred Tempez 2023-06-30 09:26:41 +02:00
parent ac0a51a8b5
commit dabc0a4c2e
3 changed files with 52 additions and 50 deletions

View File

@ -344,10 +344,7 @@ class layout extends common
$items .= $this->getData(['theme', 'footer', 'displaymemberAccount']) === false ? ' class="displayNone">' : '>';
$items .= '<wbr>&nbsp;|&nbsp;';
if (
$this->getUser(
'permission',
'filemanager'
) === true
$this->getUser('permission', 'filemanager') === true
) {
$items .= '<wbr>' . template::ico('folder', [
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']),
@ -356,11 +353,15 @@ class layout extends common
'help' => 'Fichiers du site'
]);
}
$items .= '<wbr>' . template::ico('user', [
'margin' => 'all',
'help' => 'Mon compte',
'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id')
]);
if (
$this->getUser('permission', 'user', 'edit') === true
) {
$items .= '<wbr>' . template::ico('user', [
'margin' => 'all',
'help' => 'Mon compte',
'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id')
]);
}
$items .= '<wbr>' . template::ico('logout', [
'margin' => 'all',
'help' => 'Déconnecter',
@ -501,11 +502,8 @@ class layout extends common
&& $this->getData(['theme', 'menu', 'memberBar']) === true
) {
if (
$this->getUser('group') >= self::GROUP_MEMBER && $this->getUser(
'permission',
'folder',
'share'
) === true
$this->getUser('group') >= self::GROUP_MEMBER &&
$this->getUser('permission', 'folder', 'share') === true
) {
$itemsRight .= '<li>' . template::ico('folder', [
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']),
@ -513,11 +511,15 @@ class layout extends common
'help' => 'Fichiers du site'
]) . '</li>';
}
$itemsRight .= '<li>' . template::ico('user', [
'help' => 'Mon compte',
'margin' => 'right',
'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id')
]) . '</li>';
if (
$this->getUser('permission', 'user', 'edit') === true
) {
$itemsRight .= '<li>' . template::ico('user', [
'help' => 'Mon compte',
'margin' => 'right',
'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id')
]) . '</li>';
}
$itemsRight .= '<li>' .
template::ico('logout', [
'help' => 'Déconnecter',

View File

@ -45,20 +45,6 @@
</div>
</div>
<div class="row containerPage">
<div class="row">
<div class="col12">
<div class="block">
<h4>
<?php echo helper::translate('Compte de l\'utilisateur'); ?>
</h4>
<div class="row">
<div class="col3">
<?php echo template::checkbox('profilAddUserEdit', true, 'Éditer'); ?>
</div>
</div>
</div>
</div>
</div>
<div class="col12">
<div class="block">
<h4>
@ -123,7 +109,7 @@
</div>
</div>
<div class="row">
<div class="col6"s>
<div class="col6" s>
<?php echo template::checkbox('profilAddBlogCommentDelete', true, 'Supprimer les commentaires'); ?>
</div>
<div class="col6">
@ -243,6 +229,20 @@
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>
<?php echo helper::translate('Compte de l\'utilisateur'); ?>
</h4>
<div class="row">
<div class="col3">
<?php echo template::checkbox('profilAddUserEdit', true, 'Éditer'); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">

View File

@ -52,22 +52,6 @@
</div>
</div>
<?php if ($this->getUrl(2) >= self::GROUP_MODERATOR): ?>
<div class="row">
<div class="col12">
<div class="block">
<h4>
<?php echo helper::translate('Compte de l\'utilisateur'); ?>
</h4>
<div class="row">
<div class="col3">
<?php echo template::checkbox('profilEditUserEdit', true, 'Éditer', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'user', 'edit'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
@ -314,6 +298,22 @@
</div>
</div>
<?php endif; ?>
<div class="row">
<div class="col12">
<div class="block">
<h4>
<?php echo helper::translate('Compte de l\'utilisateur'); ?>
</h4>
<div class="row">
<div class="col3">
<?php echo template::checkbox('profilEditUserEdit', true, 'Éditer', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'user', 'edit'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">