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

View File

@ -65,9 +65,9 @@
'selected' => $this->getData(['user', $this->getUrl(2), 'group'])
]); ?>
<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']),
'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 id="userEditLabelAuth">Autorisations :</div>

View File

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