Răsfoiți Sursa

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

Julio Montoya 14 ani în urmă
părinte
comite
a33215b28a
2 a modificat fișierele cu 424 adăugiri și 258 ștergeri
  1. 4 2
      main/document/document.php
  2. 420 256
      main/inc/lib/document.lib.php

+ 4 - 2
main/document/document.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 (!$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();
                 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
         // Security fix: make sure they can't move files that are not in the document table
         if (!empty($document_to_move)) {
         if (!empty($document_to_move)) {
             if (move($base_work_dir.$document_to_move['path'], $base_work_dir.$_POST['move_to'])) {
             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']));
                 update_db_info('update', $document_to_move['path'], $_POST['move_to'].'/'.basename($document_to_move['path']));
                 // Set the current path
                 // Set the current path
                 $curdirpath = $_POST['move_to'];
                 $curdirpath = $_POST['move_to'];

Fișier diff suprimat deoarece este prea mare
+ 420 - 256
main/inc/lib/document.lib.php


Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff