petites modifs

This commit is contained in:
Fred Tempez 2021-06-07 19:23:39 +02:00
parent ff93b545b9
commit 741c041f17
3 changed files with 67 additions and 63 deletions

View File

@ -47,8 +47,9 @@
'selected' => self::GROUP_MEMBER 'selected' => self::GROUP_MEMBER
]); ?> ]); ?>
<div id="userAddMemberFiles" class="displayNone"> <div id="userAddMemberFiles" class="displayNone">
<?php echo template::checkbox('userAddFiles', true, 'Updown et download autorisés', [ <?php echo template::checkbox('userAddFiles', true, 'Partage de fichiers autorisé', [
'checked' => false 'checked' => false,
'help' => 'Ce membre pourra téléverser ou télécharger des fichiers dans le dossier \'partage\' et ses sous-dossiers'
]); ?> ]); ?>
</div> </div>
Autorisations : Autorisations :

View File

@ -65,9 +65,9 @@
'selected' => $this->getData(['user', $this->getUrl(2), 'group']) 'selected' => $this->getData(['user', $this->getUrl(2), 'group'])
]); ?> ]); ?>
<div id="userEditMemberFiles" class="displayNone"> <div id="userEditMemberFiles" class="displayNone">
<?php echo template::checkbox('userEditFiles', true, 'Updown et download autorisés', [ <?php echo template::checkbox('userEditFiles', true, 'Partage de fichiers autorisé', [
'checked' => $this->getData(['user', $this->getUrl(2), 'files']), 'checked' => $this->getData(['user', $this->getUrl(2), 'files']),
'help' => 'Ce membre pourra déposer ou télécharger des fichiers dans le dossier \'updown\' et ses sous-dossiers' 'help' => 'Ce membre pourra téléverser ou télécharger des fichiers dans le dossier \'partage\' et ses sous-dossiers'
]); ?> ]); ?>
</div> </div>
<div id="userEditLabelAuth">Autorisations :</div> <div id="userEditLabelAuth">Autorisations :</div>

View File

@ -20,66 +20,69 @@ $tab = json_decode($json, true);
$group = $tab['user'][$userId]['group']; $group = $tab['user'][$userId]['group'];
$uploadDir = '/site/file/source/'; $uploadDir = '/site/file/source/';
$currentPath = '../../../site/file/source/'; $currentPath = '../../../site/file/source/';
if( $group === 3){ switch ($group) {
// Administrateur, droits maximum case 3:
$deleteFiles = true; // Administrateur, droits maximum
$createFolders = true; $deleteFiles = true;
$deleteFolders = true; $createFolders = true;
$uploadFiles = true; $deleteFolders = true;
$renameFiles = true; $uploadFiles = true;
$renameFolders = true; $renameFiles = true;
$duplicateFiles = true; $renameFolders = true;
$extractFiles = true; $duplicateFiles = true;
$copycutFiles = true; $extractFiles = true;
$copycutDirs = true; $copycutFiles = true;
$chmodFiles = true; $copycutDirs = true;
$chmodDirs = true; $chmodFiles = true;
$previewtextFiles = true; $chmodDirs = true;
$edittextFiles = true; $previewtextFiles = true;
$createtextFiles = true; $edittextFiles = true;
$downloadFiles = true; $createtextFiles = true;
} $downloadFiles = true;
elseif( $group === 2){ break;
// Modérateur éditeur case 2:
$deleteFiles = false; // Modérateur éditeur
$createFolders = true; $deleteFiles = false;
$deleteFolders = false; $createFolders = true;
$uploadFiles = true; $deleteFolders = false;
$renameFiles = true; $uploadFiles = true;
$renameFolders = false; $renameFiles = true;
$duplicateFiles = true; $renameFolders = false;
$extractFiles = true; $duplicateFiles = true;
$copycutFiles = true; $extractFiles = true;
$copycutDirs = false; $copycutFiles = true;
$chmodFiles = false; $copycutDirs = false;
$chmodDirs = false; $chmodFiles = false;
$previewtextFiles = true; $chmodDirs = false;
$edittextFiles = true; $previewtextFiles = true;
$createtextFiles = true; $edittextFiles = true;
$downloadFiles = true; $createtextFiles = true;
} $downloadFiles = true;
else{ break;
// Membre avec droits d'upload / download default:
$uploadDir = '/site/file/source/updown/'; // Membre avec droits d'upload / download
$currentPath = '../../../site/file/source/updown/'; $uploadDir = '/site/file/source/partage/';
if(!is_dir('../../../site/file/source/updown')) mkdir ('../../../site/file/source/updown'); $currentPath = '../../../site/file/source/partage/';
$deleteFiles = false; if(!is_dir('../../../site/file/source/partage')) mkdir ('../../../site/file/source/partage');
$createFolders = false; $deleteFiles = false;
$deleteFolders = false; $createFolders = false;
$uploadFiles = true; $deleteFolders = false;
$renameFiles = false; $uploadFiles = true;
$renameFolders = false; $renameFiles = false;
$duplicateFiles = false; $renameFolders = false;
$extractFiles = false; $duplicateFiles = false;
$copycutFiles = true; $extractFiles = false;
$copycutDirs = false; $copycutFiles = true;
$chmodFiles = false; $copycutDirs = false;
$chmodDirs = false; $chmodFiles = false;
$previewtextFiles = false; $chmodDirs = false;
$edittextFiles = false; $previewtextFiles = false;
$createtextFiles = false; $edittextFiles = false;
$downloadFiles = true; $createtextFiles = false;
$downloadFiles = true;
break;
} }
/* Fin lecture du groupe de l'utilisateur connecté pour attribuer les droits et les dossiers */ /* Fin lecture du groupe de l'utilisateur connecté pour attribuer les droits et les dossiers */
/* /*