Profil RFM
This commit is contained in:
parent
4901cb9052
commit
f2636c87d8
@ -317,7 +317,7 @@ class layout extends common
|
|||||||
$items .= '<span id="footerDisplayCookie"';
|
$items .= '<span id="footerDisplayCookie"';
|
||||||
$items .= ($this->getData(['config', 'cookieConsent']) === true && $this->getData(['theme', 'footer', 'displayCookie']) === true) ? '>' : ' class="displayNone" >';
|
$items .= ($this->getData(['config', 'cookieConsent']) === true && $this->getData(['theme', 'footer', 'displayCookie']) === true) ? '>' : ' class="displayNone" >';
|
||||||
$label = empty($this->getData(['locale', 'cookies', 'cookiesFooterText'])) ? 'Cookies' : $this->getData(['locale', 'cookies', 'cookiesFooterText']);
|
$label = empty($this->getData(['locale', 'cookies', 'cookiesFooterText'])) ? 'Cookies' : $this->getData(['locale', 'cookies', 'cookiesFooterText']);
|
||||||
$items .= '<wbr> | <a href="javascript:void(0)" class="skiptranslate" id="footerLinkCookie">' . $label . '</a>';
|
$items .= '<wbr> | <a href="javascript:void(0)" id="footerLinkCookie">' . $label . '</a>';
|
||||||
$items .= '</span>';
|
$items .= '</span>';
|
||||||
// Affichage du lien de connexion
|
// Affichage du lien de connexion
|
||||||
if (
|
if (
|
||||||
@ -344,7 +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> | ';
|
$items .= '<wbr> | ';
|
||||||
if (
|
if (
|
||||||
$this->getUser('group') >= self::GROUP_MEMBER && $this->getPermission('folder', 'share') === true
|
$this->getPermission('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']),
|
||||||
@ -354,10 +354,10 @@ class layout extends common
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$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') . '/' . $_SESSION['csrf']
|
'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id') . '/' . $_SESSION['csrf']
|
||||||
]);
|
]);
|
||||||
$items .= '<wbr>' . template::ico('logout', [
|
$items .= '<wbr>' . template::ico('logout', [
|
||||||
'margin' => 'all',
|
'margin' => 'all',
|
||||||
'help' => 'Déconnecter',
|
'help' => 'Déconnecter',
|
||||||
@ -523,14 +523,14 @@ class layout extends common
|
|||||||
// Drapeau les langues
|
// Drapeau les langues
|
||||||
foreach (self::$languages as $key => $value) {
|
foreach (self::$languages as $key => $value) {
|
||||||
if (is_dir(self::DATA_DIR . $key)) {
|
if (is_dir(self::DATA_DIR . $key)) {
|
||||||
$t[] = $this->showi18n($key);
|
$t[] = $this->showi18n($key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Pas de drapeau si la langue est unique
|
// Pas de drapeau si la langue est unique
|
||||||
if (count($t) > 1) {
|
if (count($t) > 1) {
|
||||||
foreach ($t as $key) {
|
foreach ($t as $key) {
|
||||||
echo $key;
|
echo $key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo '</ul>';
|
echo '</ul>';
|
||||||
}
|
}
|
||||||
@ -926,7 +926,7 @@ class layout extends common
|
|||||||
}
|
}
|
||||||
$leftItems .= '</optgroup' >
|
$leftItems .= '</optgroup' >
|
||||||
// Afficher les barres
|
// Afficher les barres
|
||||||
$leftItems .= '<optgroup label="'.helper::translate('Barres latérales').'">';
|
$leftItems .= '<optgroup label="' . helper::translate('Barres latérales') . '">';
|
||||||
foreach ($this->getHierarchy(null, false, true) as $parentPageId => $childrenPageIds) {
|
foreach ($this->getHierarchy(null, false, true) as $parentPageId => $childrenPageIds) {
|
||||||
$leftItems .= '<option value="' . helper::baseUrl() . $parentPageId . '"' . ($parentPageId === $currentPageId ? ' selected' : false) . '>' . $this->getData(['page', $parentPageId, 'shortTitle']) . '</option>';
|
$leftItems .= '<option value="' . helper::baseUrl() . $parentPageId . '"' . ($parentPageId === $currentPageId ? ' selected' : false) . '>' . $this->getData(['page', $parentPageId, 'shortTitle']) . '</option>';
|
||||||
foreach ($childrenPageIds as $childKey) {
|
foreach ($childrenPageIds as $childKey) {
|
||||||
@ -977,7 +977,10 @@ class layout extends common
|
|||||||
}
|
}
|
||||||
// Items de droite
|
// Items de droite
|
||||||
$rightItems = '';
|
$rightItems = '';
|
||||||
if ($this->getUser('group') >= self::GROUP_MODERATOR) {
|
if (
|
||||||
|
$this->getUser('group') >= self::GROUP_MODERATOR
|
||||||
|
&& $this->getPermission('filemanager')
|
||||||
|
) {
|
||||||
$rightItems .= '<li>' . template::ico('folder', [
|
$rightItems .= '<li>' . template::ico('folder', [
|
||||||
'help' => 'Fichiers',
|
'help' => 'Fichiers',
|
||||||
'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']),
|
||||||
|
@ -415,7 +415,6 @@ class common
|
|||||||
// Mise à jour des données core
|
// Mise à jour des données core
|
||||||
include('core/include/update.inc.php');
|
include('core/include/update.inc.php');
|
||||||
|
|
||||||
|
|
||||||
// Données de proxy
|
// Données de proxy
|
||||||
$proxy = $this->getData(['config', 'proxyType']) . $this->getData(['config', 'proxyUrl']) . ':' . $this->getData(['config', 'proxyPort']);
|
$proxy = $this->getData(['config', 'proxyType']) . $this->getData(['config', 'proxyUrl']) . ':' . $this->getData(['config', 'proxyPort']);
|
||||||
if (
|
if (
|
||||||
@ -911,13 +910,25 @@ class common
|
|||||||
{
|
{
|
||||||
if (is_array($this->user) === false) {
|
if (is_array($this->user) === false) {
|
||||||
return false;
|
return false;
|
||||||
} elseif ($key2 === null && array_key_exists($key1, $this->getData(['profil', $this->user['group']]))) {
|
} elseif ($this->getUser('group') === self::GROUP_ADMIN) {
|
||||||
return $this->getData(['profil', $this->user['group'], $key1]);
|
return true;
|
||||||
} elseif ($key2 && array_key_exists($key2, $this->getData(['profil', $this->user['group'], $key1]))) {
|
} elseif ($this->getUser('group') < 1) {
|
||||||
return $this->getData(['profil', $this->user['group'], $key1, $key2]);
|
return false;
|
||||||
|
} elseif (
|
||||||
|
$key2
|
||||||
|
&& $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1])
|
||||||
|
&& array_key_exists($key2, $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1]))
|
||||||
|
) {
|
||||||
|
return $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1, $key2]);
|
||||||
|
} elseif (
|
||||||
|
$this->getData(['profil', $this->user['group'], $this->user['profil']])
|
||||||
|
&& array_key_exists($key1, $this->getData(['profil', $this->user['group'], $this->user['profil']]))
|
||||||
|
) {
|
||||||
|
return $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1]);
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1320,12 +1331,13 @@ class common
|
|||||||
/**
|
/**
|
||||||
* Journalisation
|
* Journalisation
|
||||||
*/
|
*/
|
||||||
public function saveLog($message = '') {
|
public function saveLog($message = '')
|
||||||
|
{
|
||||||
// Journalisation
|
// Journalisation
|
||||||
$dataLog = helper::dateUTF8('%Y %m %d', time()) . ' - ' . helper::dateUTF8('%H:%M', time());
|
$dataLog = helper::dateUTF8('%Y %m %d', time()) . ' - ' . helper::dateUTF8('%H:%M', time());
|
||||||
$dataLog .= helper::getIp($this->getData(['config', 'connect', 'anonymousIp'])) . ';';
|
$dataLog .= helper::getIp($this->getData(['config', 'connect', 'anonymousIp'])) . ';';
|
||||||
$dataLog .= empty($this->getUser('id')) ? 'visitor;' : $this->getUser('id') . ';';
|
$dataLog .= empty($this->getUser('id')) ? 'visitor;' : $this->getUser('id') . ';';
|
||||||
$dataLog .= $message ? $this->getUrl() . ';'. $message : $this->getUrl();
|
$dataLog .= $message ? $this->getUrl() . ';' . $message : $this->getUrl();
|
||||||
$dataLog .= PHP_EOL;
|
$dataLog .= PHP_EOL;
|
||||||
if ($this->getData(['config', 'connect', 'log'])) {
|
if ($this->getData(['config', 'connect', 'log'])) {
|
||||||
file_put_contents(self::DATA_DIR . 'journal.log', $dataLog, FILE_APPEND);
|
file_put_contents(self::DATA_DIR . 'journal.log', $dataLog, FILE_APPEND);
|
||||||
|
@ -313,6 +313,7 @@ class init extends common
|
|||||||
'name' => 'Membre simple',
|
'name' => 'Membre simple',
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'comment' => 'Accède aux pages réservées',
|
'comment' => 'Accède aux pages réservées',
|
||||||
|
'filemanager' => false,
|
||||||
'file' => [
|
'file' => [
|
||||||
'download' => false,
|
'download' => false,
|
||||||
'edit' => false,
|
'edit' => false,
|
||||||
@ -333,13 +334,14 @@ class init extends common
|
|||||||
'copycut' => false,
|
'copycut' => false,
|
||||||
'chmod' => false,
|
'chmod' => false,
|
||||||
'share' => false,
|
'share' => false,
|
||||||
'path' => './site/file/source/partage/',
|
'path' => null,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'1' => [
|
'1' => [
|
||||||
'name' => 'Membre',
|
'name' => 'Membre',
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'comment' => 'Accède aux pages réservées et à un dossier partagé',
|
'comment' => 'Accède aux pages réservées et à un dossier partagé',
|
||||||
|
'filemanager' => true,
|
||||||
'file' => [
|
'file' => [
|
||||||
'download' => false,
|
'download' => false,
|
||||||
'edit' => false,
|
'edit' => false,
|
||||||
@ -369,6 +371,7 @@ class init extends common
|
|||||||
'name' => 'Modérateur',
|
'name' => 'Modérateur',
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'comment' => 'Edition des pages',
|
'comment' => 'Edition des pages',
|
||||||
|
'filemanager' => true,
|
||||||
'file' => [
|
'file' => [
|
||||||
'download' => true,
|
'download' => true,
|
||||||
'edit' => true,
|
'edit' => true,
|
||||||
@ -396,6 +399,7 @@ class init extends common
|
|||||||
'name' => 'Editeur avec gestion des fichiers',
|
'name' => 'Editeur avec gestion des fichiers',
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'comment' => 'Edition des pages',
|
'comment' => 'Edition des pages',
|
||||||
|
'filemanager' => true,
|
||||||
'file' => [
|
'file' => [
|
||||||
'download' => true,
|
'download' => true,
|
||||||
'edit' => true,
|
'edit' => true,
|
||||||
|
@ -535,8 +535,6 @@ class user extends common
|
|||||||
$this->deleteData(['profil', $oldGroup, $profil]);
|
$this->deleteData(['profil', $oldGroup, $profil]);
|
||||||
$profil = helper::increment($profil, $this->getData(['profil', $group]));
|
$profil = helper::increment($profil, $this->getData(['profil', $group]));
|
||||||
}
|
}
|
||||||
echo "groupe " . $group;
|
|
||||||
echo "profil " . $profil;
|
|
||||||
$this->setData([
|
$this->setData([
|
||||||
'profil',
|
'profil',
|
||||||
$group,
|
$group,
|
||||||
@ -545,6 +543,7 @@ class user extends common
|
|||||||
'name' => $this->getInput('profilEditName', helper::FILTER_STRING_SHORT, true),
|
'name' => $this->getInput('profilEditName', helper::FILTER_STRING_SHORT, true),
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'comment' => $this->getInput('profilEditComment', helper::FILTER_STRING_SHORT, true),
|
'comment' => $this->getInput('profilEditComment', helper::FILTER_STRING_SHORT, true),
|
||||||
|
'filemanager' => $this->getInput('profilEditFileManager', helper::FILTER_BOOLEAN),
|
||||||
'file' => [
|
'file' => [
|
||||||
'download' => $this->getInput('profilEditDownload', helper::FILTER_BOOLEAN),
|
'download' => $this->getInput('profilEditDownload', helper::FILTER_BOOLEAN),
|
||||||
'edit' => $this->getInput('profilEditEdit', helper::FILTER_BOOLEAN),
|
'edit' => $this->getInput('profilEditEdit', helper::FILTER_BOOLEAN),
|
||||||
@ -564,7 +563,6 @@ class user extends common
|
|||||||
'rename' => $this->getInput('profilEditFolderRename', helper::FILTER_BOOLEAN),
|
'rename' => $this->getInput('profilEditFolderRename', helper::FILTER_BOOLEAN),
|
||||||
'copycut' => $this->getInput('profilEditFolderCopycut', helper::FILTER_BOOLEAN),
|
'copycut' => $this->getInput('profilEditFolderCopycut', helper::FILTER_BOOLEAN),
|
||||||
'chmod' => $this->getInput('profilEditFolderChmod', helper::FILTER_BOOLEAN),
|
'chmod' => $this->getInput('profilEditFolderChmod', helper::FILTER_BOOLEAN),
|
||||||
'share' => $this->getInput('profilEditShare', helper::FILTER_BOOLEAN),
|
|
||||||
'path' => $this->getInput('profilEditPath'),
|
'path' => $this->getInput('profilEditPath'),
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@ -595,6 +593,48 @@ class user extends common
|
|||||||
|
|
||||||
public function profilAdd()
|
public function profilAdd()
|
||||||
{
|
{
|
||||||
|
// Soumission du formulaire
|
||||||
|
if ($this->isPost()) {
|
||||||
|
// Sauvegarder les données
|
||||||
|
$this->setData([
|
||||||
|
'profil',
|
||||||
|
$this->getInput('profilAddGroup'),
|
||||||
|
$this->getInput('profilAddProfil'),
|
||||||
|
[
|
||||||
|
'name' => $this->getInput('profilAddName', helper::FILTER_STRING_SHORT, true),
|
||||||
|
'readonly' => false,
|
||||||
|
'comment' => $this->getInput('profilAddComment', helper::FILTER_STRING_SHORT, true),
|
||||||
|
'filemanager' => $this->getInput('profilAddFileManager', helper::FILTER_BOOLEAN),
|
||||||
|
'file' => [
|
||||||
|
'download' => $this->getInput('profilAddDownload', helper::FILTER_BOOLEAN),
|
||||||
|
'edit' => $this->getInput('profilAddEdit', helper::FILTER_BOOLEAN),
|
||||||
|
'create' => $this->getInput('profilAddCreate', helper::FILTER_BOOLEAN),
|
||||||
|
'rename' => $this->getInput('profilAddRename', helper::FILTER_BOOLEAN),
|
||||||
|
'upload' => $this->getInput('profilAddUpload', helper::FILTER_BOOLEAN),
|
||||||
|
'delete' => $this->getInput('profilAddDelete', helper::FILTER_BOOLEAN),
|
||||||
|
'preview' => $this->getInput('profilAddPreview', helper::FILTER_BOOLEAN),
|
||||||
|
'duplicate' => $this->getInput('profilAddDuplicate', helper::FILTER_BOOLEAN),
|
||||||
|
'extract' => $this->getInput('profilAddExtract', helper::FILTER_BOOLEAN),
|
||||||
|
'copycut' => $this->getInput('profilAddCopycut', helper::FILTER_BOOLEAN),
|
||||||
|
'chmod' => $this->getInput('profilAddChmod', helper::FILTER_BOOLEAN),
|
||||||
|
],
|
||||||
|
'folder' => [
|
||||||
|
'create' => $this->getInput('profilAddFolderCreate', helper::FILTER_BOOLEAN),
|
||||||
|
'delete' => $this->getInput('profilAddFolderDelete', helper::FILTER_BOOLEAN),
|
||||||
|
'rename' => $this->getInput('profilAddFolderRename', helper::FILTER_BOOLEAN),
|
||||||
|
'copycut' => $this->getInput('profilAddFolderCopycut', helper::FILTER_BOOLEAN),
|
||||||
|
'chmod' => $this->getInput('profilAddFolderChmod', helper::FILTER_BOOLEAN),
|
||||||
|
'path' => $this->getInput('profilAddPath'),
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
// Valeurs en sortie
|
||||||
|
$this->addOutput([
|
||||||
|
'redirect' => helper::baseUrl() . 'user/profil',
|
||||||
|
'notification' => helper::translate('Modifications enregistrées'),
|
||||||
|
'state' => true
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
// Valeurs en sortie;
|
// Valeurs en sortie;
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col3">
|
<div class="col3">
|
||||||
<?php echo template::checkbox('profilAddShare', true, 'Activé'); ?>
|
<?php echo template::checkbox('profilAddFileManager', true, 'Activé'); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::select('profilAddPath', $module::$sharePath, [
|
<?php echo template::select('profilAddPath', $module::$sharePath, [
|
||||||
|
@ -52,8 +52,8 @@
|
|||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col3">
|
<div class="col3">
|
||||||
<?php echo template::checkbox('profilEditShare', true, 'Activé', [
|
<?php echo template::checkbox('profilEditFileManager', true, 'Activé', [
|
||||||
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'folder', 'share'])
|
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'filemanager'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
|
2
core/vendor/filemanager/config/config.php
vendored
2
core/vendor/filemanager/config/config.php
vendored
@ -424,7 +424,7 @@ $config = array(
|
|||||||
// for copy/cut files
|
// for copy/cut files
|
||||||
'copy_cut_dirs' => $folder['copycut'] ? $folder['copycut'] : false,
|
'copy_cut_dirs' => $folder['copycut'] ? $folder['copycut'] : false,
|
||||||
// for copy/cut directories
|
// for copy/cut directories
|
||||||
'chmod_files' => $file['permission'] ? $file['permission'] : false,
|
'chmod_files' => $file['chmod'] ? $file['chmod'] : false,
|
||||||
// change file permissions
|
// change file permissions
|
||||||
'chmod_dirs' => $folder['chmod'] ? $folder['chmod'] : false,
|
'chmod_dirs' => $folder['chmod'] ? $folder['chmod'] : false,
|
||||||
// change folder permissions
|
// change folder permissions
|
||||||
|
Loading…
Reference in New Issue
Block a user