diff --git a/core/class/jsondb/JsonDb.class.php b/core/class/jsondb/JsonDb.class.php index 3e3b26c..321ffe5 100644 --- a/core/class/jsondb/JsonDb.class.php +++ b/core/class/jsondb/JsonDb.class.php @@ -142,6 +142,7 @@ class JsonDb extends \Prowebcraft\Dot */ public function save() { + /// $v = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT | JSON_PRETTY_PRINT); $v = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT); $l = strlen($v); $t = 0; diff --git a/core/class/layout.class.php b/core/class/layout.class.php index 38b5969..ae15b3e 100644 --- a/core/class/layout.class.php +++ b/core/class/layout.class.php @@ -352,7 +352,8 @@ class layout extends common $items .= $this->getData(['theme', 'footer', 'displaymemberAccount']) === false ? ' class="displayNone">' : '>'; $items .= ' | '; if ( - $this->getUser('permission', 'filemanager') === true + $this->getUser('permission', 'filemanager') === true + && $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none' ) { $items .= '' . 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']), @@ -519,7 +520,8 @@ class layout extends common ) { // Affiche l'icône RFM - if ($this->getUser('permission', 'filemanager') === true) { + if ($this->getUser('permission', 'filemanager') === true + && $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none') { $itemsRight .= '
  • ' . 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']), 'attr' => 'data-lity', @@ -1060,7 +1062,8 @@ class layout extends common if ( ( $this->getUser('group') === self::GROUP_EDITOR - && $this->getUser('permission', 'filemanager') + && $this->getUser('permission', 'filemanager') === true + && $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none' ) || $this->getUser('group') === self::GROUP_ADMIN ) { diff --git a/core/module/user/user.php b/core/module/user/user.php index cc4f862..6b6fff5 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -760,16 +760,18 @@ class user extends common self::$sharePath = $this->getSubdirectories('./site/file/source'); // Exclure les espaces des cours + /* foreach (array_keys($this->getData(['course'])) as $courseId) { self::$sharePath = array_filter(self::$sharePath, function ($key) use ($courseId) { return strpos($key, $courseId) === false; }); } + */ self::$sharePath = array_flip(self::$sharePath); - self::$sharePath = array_merge(['./site/file/source/' => 'Tout le gestionnaire de fichiers'], self::$sharePath); - // self::$sharePath = array_merge(['' => 'Aucun dossier'], self::$sharePath); + self::$sharePath = array_merge(['none' => 'Aucun Accès'], self::$sharePath); self::$sharePath = array_merge(['' => 'Confiné dans le dossier de l\'espace ouvert'], self::$sharePath); + self::$sharePath = array_merge(['./site/file/source/' => 'Tout le gestionnaire de fichiers'], self::$sharePath); // Liste des modules installés self::$listModules = helper::getModules(); @@ -960,16 +962,18 @@ class user extends common self::$sharePath = $this->getSubdirectories('./site/file/source'); // Exclure les espaces des cours + /* foreach (array_keys($this->getData(['course'])) as $courseId) { self::$sharePath = array_filter(self::$sharePath, function ($key) use ($courseId) { return strpos($key, $courseId) === false; }); } + */ self::$sharePath = array_flip(self::$sharePath); - self::$sharePath = array_merge(['./site/file/source/' => 'Tout le gestionnaire de fichiers'], self::$sharePath); - //self::$sharePath = array_merge(['' => 'Aucun dossier'], self::$sharePath); + self::$sharePath = array_merge(['none' => 'Aucun Accès'], self::$sharePath); self::$sharePath = array_merge(['' => 'Confiné dans le dossier de l\'espace ouvert'], self::$sharePath); + self::$sharePath = array_merge(['./site/file/source/' => 'Tout le gestionnaire de fichiers'], self::$sharePath); // Liste des modules installés self::$listModules = helper::getModules(); diff --git a/core/module/user/view/profilEdit/profilEdit.php b/core/module/user/view/profilEdit/profilEdit.php index 6f94d4f..b0b3428 100644 --- a/core/module/user/view/profilEdit/profilEdit.php +++ b/core/module/user/view/profilEdit/profilEdit.php @@ -96,14 +96,23 @@ 'Dossier depuis un espace', 'class' => 'filemanager', - 'selected' => '.' . $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'folder', 'coursePath']), + /* + * 'none' interdit l'accès au gestionnaire de fichier + * Ce n'est pas un chemin donc on n'ajoute pas le . + */ + 'selected' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'folder', 'coursePath']) !== 'none' + ? '.' . $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'folder', 'coursePath']) + : $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'folder', 'coursePath']) ]); ?>
    'Dossier depuis l\'accueil', 'class' => 'filemanager', - 'selected' => '.' . $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'folder', 'homePath']), + // 'none' interdit l'accès au gestionnaire de fichier au niveau de l'accueil + 'selected' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'folder', 'homePath']) !== 'none' + ? '.' . $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'folder', 'homePath']) + : $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'folder', 'homePath']) ]); ?>