Code Duplication    Length = 7-9 lines in 2 locations

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

main/work/work.lib.php 1 location

@@ 880-886 (lines=7) @@
877
878
            $new_dir = $work_data_url.'_DELETED_'.$id;
879
880
            if (api_get_setting('permanently_remove_deleted_files') == 'true') {
881
                my_delete($work_data_url);
882
            } else {
883
                if (file_exists($work_data_url)) {
884
                    rename($work_data_url, $new_dir);
885
                }
886
            }
887
888
            // Gets calendar_id from student_publication_assigment
889
            $sql = "SELECT add_to_calendar FROM $TSTDPUBASG