From 2a491bb85dbb2e76d4e3e5ba885a6fb308bcb295 Mon Sep 17 00:00:00 2001 From: Cristian Fasanando Date: Thu, 5 Feb 2009 23:07:04 +0100 Subject: [PATCH] [svn r18270] Logic change - Fixed the folders by default into document toll must not be removed - see FS#3611 --- documentation/changelog.html | 1 + main/document/document.inc.php | 4 ++-- main/document/document.php | 12 +++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/documentation/changelog.html b/documentation/changelog.html index 214392f9aa..3fee700ddd 100644 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -163,6 +163,7 @@
  • Fixed 31 bugs in file/image/sounds/flash uploads/delete/permissions in profile/homepage/agenda edition pages
  • Fixed a bug in migration for several versions at once whereby new course tools were repeated several times (SVN#17935)
  • Fixed security issue allowing users to upload php files on the server through FCKEditor (FS#2970)
  • +
  • Fixed folders by default into document tool must not be removed - see FS#3611

  • CSS changes

    diff --git a/main/document/document.inc.php b/main/document/document.inc.php index 44c2cc03e4..d6048f9d7c 100644 --- a/main/document/document.inc.php +++ b/main/document/document.inc.php @@ -1,4 +1,4 @@ -'; - if (strcmp($path,'/audio')===0 or strcmp($path,'/flash')===0 or strcmp($path,'/images')===0) { + if (strcmp($path,'/audio')===0 or strcmp($path,'/flash')===0 or strcmp($path,'/images')===0 or strcmp($path,'/shared_folder')===0 or strcmp($path,'/video')===0) { $modify_icons .= ' '.get_lang('Delete').''; } else { $modify_icons .= ' '; diff --git a/main/document/document.php b/main/document/document.php index 54d197abc4..88aa43f25b 100644 --- a/main/document/document.php +++ b/main/document/document.php @@ -1,4 +1,4 @@ - $path) + foreach($_POST['path'] as $index => $path) { - DocumentManager::delete_document($_course,$path,$base_work_dir); + if (strcmp($path,'/audio')===0 or strcmp($path,'/flash')===0 or strcmp($path,'/images')===0 or strcmp($path,'/shared_folder')===0 or strcmp($path,'/video')===0) { + continue; + } else { + $delete_document = DocumentManager::delete_document($_course,$path,$base_work_dir); + } } + if (!empty($delete_document)) { Display::display_confirmation_message(get_lang('DocDeleted')); + } break; } }