Pārlūkot izejas kodu

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

Julio Montoya 14 gadi atpakaļ
vecāks
revīzija
a33215b28a
2 mainītis faili ar 424 papildinājumiem un 258 dzēšanām
  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 (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'];

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 420 - 256
main/inc/lib/document.lib.php


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels