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 .= $this->getData(['theme', 'footer', 'displaymemberAccount']) === false ? ' class="displayNone">' : '>';
$items .= '<wbr>&nbsp;|&nbsp;'; $items .= '<wbr>&nbsp;|&nbsp;';
if ( if (
$this->getUser( $this->getUser('permission', 'filemanager') === true
'permission',
'filemanager'
) === true
) { ) {
$items .= '<wbr>' . template::ico('folder', [ $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']), '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' 'help' => 'Fichiers du site'
]); ]);
} }
if (
$this->getUser('permission', 'user', 'edit') === true
) {
$items .= '<wbr>' . template::ico('user', [ $items .= '<wbr>' . template::ico('user', [
'margin' => 'all', 'margin' => 'all',
'help' => 'Mon compte', 'help' => 'Mon compte',
'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id') 'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id')
]); ]);
}
$items .= '<wbr>' . template::ico('logout', [ $items .= '<wbr>' . template::ico('logout', [
'margin' => 'all', 'margin' => 'all',
'help' => 'Déconnecter', 'help' => 'Déconnecter',
@ -501,11 +502,8 @@ class layout extends common
&& $this->getData(['theme', 'menu', 'memberBar']) === true && $this->getData(['theme', 'menu', 'memberBar']) === true
) { ) {
if ( if (
$this->getUser('group') >= self::GROUP_MEMBER && $this->getUser( $this->getUser('group') >= self::GROUP_MEMBER &&
'permission', $this->getUser('permission', 'folder', 'share') === true
'folder',
'share'
) === true
) { ) {
$itemsRight .= '<li>' . template::ico('folder', [ $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']), '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' 'help' => 'Fichiers du site'
]) . '</li>'; ]) . '</li>';
} }
if (
$this->getUser('permission', 'user', 'edit') === true
) {
$itemsRight .= '<li>' . template::ico('user', [ $itemsRight .= '<li>' . template::ico('user', [
'help' => 'Mon compte', 'help' => 'Mon compte',
'margin' => 'right', 'margin' => 'right',
'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id') 'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id')
]) . '</li>'; ]) . '</li>';
}
$itemsRight .= '<li>' . $itemsRight .= '<li>' .
template::ico('logout', [ template::ico('logout', [
'help' => 'Déconnecter', 'help' => 'Déconnecter',

View File

@ -45,20 +45,6 @@
</div> </div>
</div> </div>
<div class="row containerPage"> <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="col12">
<div class="block"> <div class="block">
<h4> <h4>
@ -243,6 +229,20 @@
</div> </div>
</div> </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="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">

View File

@ -52,22 +52,6 @@
</div> </div>
</div> </div>
<?php if ($this->getUrl(2) >= self::GROUP_MODERATOR): ?> <?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="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
@ -314,6 +298,22 @@
</div> </div>
</div> </div>
<?php endif; ?> <?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="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">