From 35a0bde533d2fe4a77db1d0b94a68e1eda99ce08 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Fri, 6 Oct 2023 09:16:49 +0200 Subject: [PATCH] fix profil empty path --- core/module/user/user.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/module/user/user.php b/core/module/user/user.php index 64c9bfd..df67dcb 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -678,8 +678,15 @@ class user extends common // Nombre de profils de ce groupe $group = $this->getInput('profilAddGroup'); $profil = count($this->getData(['profil', $group])); - // Vérifier le quota du nombre de profils dans le groupe - var_dump($profil < self::MAX_PROFILS); + // Gère le chemin + $fileManager = $this->getInput('profilAddFileManager', helper::FILTER_BOOLEAN); + $path = $this->getInput('profilAddPath'); + if ($group <= self::GROUP_ADMIN + && $fileManager + && empty($path) + ) { + $fileManager = false; + } if ($profil < self::MAX_PROFILS) { $profil = (string) ($profil + 1); @@ -689,7 +696,7 @@ class user extends common 'readonly' => false, 'permanent' => false, 'comment' => $this->getInput('profilAddComment', helper::FILTER_STRING_SHORT, true), - 'filemanager' => $this->getInput('profilAddFileManager', helper::FILTER_BOOLEAN), + 'filemanager' => $fileManager, 'file' => [ 'download' => $this->getInput('profilAddDownload', helper::FILTER_BOOLEAN), 'edit' => $this->getInput('profilAddEdit', helper::FILTER_BOOLEAN), @@ -709,7 +716,7 @@ class user extends common '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'), + 'path' => $path, ], 'page' => [ 'add' => $this->getInput('profilAddPageAdd', helper::FILTER_BOOLEAN),