From 961fcb2ecdc0e61f01b94bbb4b026fe65e6ad5a3 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Fri, 6 Oct 2023 09:09:43 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20s=C3=A9curit=C3=A9=20profil=20filmaanager?= =?UTF-8?q?=20path=20empty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 1 + core/module/user/user.php | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3a077c4e..2989b82c 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ ## Version 13.0.04 # Corrections +- Corrige un bug de sécurité. Lorsqu'un profil dispose des droits d'accès au gestionnaire de fichiers et qu'aucun dossier est sélectionné, la racine du site était affichée. - Erreur d'édition d'un profil de niveau 1, exemple membre simple. - Le profil de membre simple affichait le gestionnaire de fichiers dans tous les cas. - Importation d'utilisateurs en masse, le bouton de téléchargement d'un modèle était inopérant. diff --git a/core/module/user/user.php b/core/module/user/user.php index c274739c..5b239093 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -542,17 +542,25 @@ class user extends common // Les profils 1 sont désactivés dans le formulaire $profil = empty($this->getInput('profilEditProfil')) ? '1' : $this->getInput('profilEditProfil') ; $oldProfil = $this->getInput('profilEditOldProfil', helper::FILTER_STRING_SHORT); + // Gère le chemin + $fileManager = $this->getInput('profilEditFileManager', helper::FILTER_BOOLEAN); + $path = $this->getInput('profilEditPath'); + if ($group <= self::GROUP_ADMIN + && $fileManager + && empty($path) + ) { + $fileManager = false; + } if ($profil !== $profil) { $this->deleteData(['profil', $group, $oldProfil]); } - // Données du formulaire $data = [ 'name' => $this->getInput('profilEditName', helper::FILTER_STRING_SHORT, true), 'readonly' => false, 'permanent' => $group === '1' ? true : false, 'comment' => $this->getInput('profilEditComment', helper::FILTER_STRING_SHORT, true), - 'filemanager' => $this->getInput('profilEditFileManager', helper::FILTER_BOOLEAN), + 'filemanager' => $fileManager, 'file' => [ 'download' => $this->getInput('profilEditDownload', helper::FILTER_BOOLEAN), 'edit' => $this->getInput('profilEditEdit', helper::FILTER_BOOLEAN), @@ -572,7 +580,7 @@ class user extends common 'rename' => $this->getInput('profilEditFolderRename', helper::FILTER_BOOLEAN), 'copycut' => $this->getInput('profilEditFolderCopycut', helper::FILTER_BOOLEAN), 'chmod' => $this->getInput('profilEditFolderChmod', helper::FILTER_BOOLEAN), - 'path' => $this->getInput('profilEditPath'), + 'path' => $path, ], 'page' => [ 'add' => $this->getInput('profilEditPageAdd', helper::FILTER_BOOLEAN),