Index: src/templates/docs/index.tpl
==================================================================
--- src/templates/docs/index.tpl
+++ src/templates/docs/index.tpl
@@ -94,11 +94,11 @@
{$file.name} |
|
Répertoire |
|
- {if $can_write}
+ {if $can_write && ($context == File::CONTEXT_SKELETON || $context == File::CONTEXT_DOCUMENTS)}
{linkbutton href="!common/files/rename.php?p=%s"|args:$file.path label="Renommer" shape="minus" target="_dialog"}
{/if}
{if $can_delete}
{linkbutton href="!common/files/delete.php?p=%s"|args:$file.path label="Supprimer" shape="delete" target="_dialog"}
{/if}
@@ -127,11 +127,11 @@
{/if}
{if $file->canPreview()}
{linkbutton href="!common/files/preview.php?p=%s"|args:$file.path label="Voir" shape="eye" target="_dialog" data-mime=$file.mime}
{/if}
{linkbutton href=$file->url(true) label="Télécharger" shape="download"}
- {if $can_write}
+ {if $can_write && ($context == File::CONTEXT_SKELETON || $context == File::CONTEXT_DOCUMENTS)}
{linkbutton href="!common/files/rename.php?p=%s"|args:$file.path label="Renommer" shape="minus" target="_dialog"}
{/if}
{if $can_delete}
{linkbutton href="!common/files/delete.php?p=%s"|args:$file.path label="Supprimer" shape="delete" target="_dialog"}
{/if}
Index: src/www/admin/common/files/rename.php
==================================================================
--- src/www/admin/common/files/rename.php
+++ src/www/admin/common/files/rename.php
@@ -11,16 +11,16 @@
if (!$file) {
throw new UserException('Fichier inconnu');
}
if (!$file->checkWriteAccess($session)) {
- throw new UserException('Vous n\'avez pas le droit de supprimer ce fichier.');
+ throw new UserException('Vous n\'avez pas le droit de modifier ce fichier.');
}
$context = $file->context();
-if ($context == File::CONTEXT_CONFIG || $context == File::CONTEXT_WEB) {
+if ($context != File::CONTEXT_DOCUMENTS && $context != File::CONTEXT_SKELETON) {
throw new UserException('Vous n\'avez pas le droit de renommer ce fichier.');
}
$csrf_key = 'file_rename_' . $file->pathHash();
|