Bläddra i källkod

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

Julio Montoya 14 år sedan
förälder
incheckning
a33215b28a
2 ändrade filer med 424 tillägg och 258 borttagningar
  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'];

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 420 - 256
main/inc/lib/document.lib.php


Vissa filer visades inte eftersom för många filer har ändrats