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

@@ 795-801 (lines=7) @@
792
793
            $new_dir = $work_data_url.'_DELETED_'.$id;
794
795
            if (api_get_setting('permanently_remove_deleted_files') == 'true') {
796
                my_delete($work_data_url);
797
            } else {
798
                if (file_exists($work_data_url)) {
799
                    rename($work_data_url, $new_dir);
800
                }
801
            }
802
803
            // Gets calendar_id from student_publication_assigment
804
            $sql = "SELECT add_to_calendar FROM $TSTDPUBASG