Code Duplication    Length = 7-9 lines in 2 locations

main/work/work.lib.php 1 location

@@ 819-825 (lines=7) @@
816
817
            $new_dir = $work_data_url.'_DELETED_'.$id;
818
819
            if (api_get_setting('permanently_remove_deleted_files') == 'true') {
820
                my_delete($work_data_url);
821
            } else {
822
                if (file_exists($work_data_url)) {
823
                    rename($work_data_url, $new_dir);
824
                }
825
            }
826
827
            // Gets calendar_id from student_publication_assigment
828
            $sql = "SELECT add_to_calendar FROM $TSTDPUBASG

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

@@ 420-428 (lines=9) @@
417
                //Deleting from document tool
418
                DocumentManager::delete_document($course_info, $group->secret_directory, $source_directory);
419
420
                if (file_exists($source_directory)) {
421
                    if (api_get_setting('permanently_remove_deleted_files') == 'true') {
422
                        // Delete
423
                        my_delete($source_directory);
424
                    } else {
425
                        // Rename
426
                        rename($source_directory, $destination_dir);
427
                    }
428
                }
429
            }
430
431
            $sql = "DELETE FROM $forum_table