Adding function that will fixe bug in #1278 when moving a document from one folder to other

skala
Julio Montoya 15 years ago
parent 8d78f88410
commit a33215b28a
  1. 6
      main/document/document.php
  2. 760
      main/inc/lib/document.lib.php

@ -472,8 +472,7 @@ if ($is_allowed_to_edit || $group_member_with_upload_rights || is_my_shared_fold
}
if (!$is_allowed_to_edit) {
if (DocumentManager::check_readonly($_course, api_get_user_id(), $my_get_move)) {
if (DocumentManager::check_readonly($_course, api_get_user_id(), $my_get_move)) {
api_not_allowed();
}
}
@ -525,6 +524,9 @@ if ($is_allowed_to_edit || $group_member_with_upload_rights || is_my_shared_fold
// Security fix: make sure they can't move files that are not in the document table
if (!empty($document_to_move)) {
if (move($base_work_dir.$document_to_move['path'], $base_work_dir.$_POST['move_to'])) {
//if (1) {
//$contents = DocumentManager::replace_urls_inside_content_html_when_moving_file(basename($document_to_move['path']), $base_work_dir.dirname($document_to_move['path']), $base_work_dir.$_POST['move_to']);
//exit;
update_db_info('update', $document_to_move['path'], $_POST['move_to'].'/'.basename($document_to_move['path']));
// Set the current path
$curdirpath = $_POST['move_to'];

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save