Code Duplication    Length = 7-9 lines in 2 locations

main/inc/lib/groupmanager.lib.php 1 location

@@ 407-415 (lines=9) @@
404
                //Deleting from document tool
405
                DocumentManager::delete_document($course_info, $group->secret_directory, $source_directory);
406
407
                if (file_exists($source_directory)) {
408
                    if (api_get_setting('permanently_remove_deleted_files') === 'true') {
409
                        // Delete
410
                        my_delete($source_directory);
411
                    } else {
412
                        // Rename
413
                        rename($source_directory, $destination_dir);
414
                    }
415
                }
416
            }
417
418
            $sql = "DELETE FROM $forum_table

main/work/work.lib.php 1 location

@@ 788-794 (lines=7) @@
785
786
            $new_dir = $work_data_url.'_DELETED_'.$id;
787
788
            if (api_get_setting('permanently_remove_deleted_files') == 'true') {
789
                my_delete($work_data_url);
790
            } else {
791
                if (file_exists($work_data_url)) {
792
                    rename($work_data_url, $new_dir);
793
                }
794
            }
795
796
            // Gets calendar_id from student_publication_assigment
797
            $sql = "SELECT add_to_calendar FROM $TSTDPUBASG