Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 1127-1140 (lines=14) @@
1124
        $old_file = $path_info['file'];
1125
1126
        // Let us delete them.
1127
        if (!empty($old_file)) {
1128
            if (KEEP_THE_OLD_IMAGE_AFTER_CHANGE) {
1129
                $prefix = 'saved_'.date('Y_m_d_H_i_s').'_'.uniqid('').'_';
1130
                @rename($path.'small_'.$old_file, $path.$prefix.'small_'.$old_file);
1131
                @rename($path.'medium_'.$old_file, $path.$prefix.'medium_'.$old_file);
1132
                @rename($path.'big_'.$old_file, $path.$prefix.'big_'.$old_file);
1133
                @rename($path.$old_file, $path.$prefix.$old_file);
1134
            } else {
1135
                @unlink($path.'small_'.$old_file);
1136
                @unlink($path.'medium_'.$old_file);
1137
                @unlink($path.'big_'.$old_file);
1138
                @unlink($path.$old_file);
1139
            }
1140
        }
1141
1142
        // Exit if only deletion has been requested. Return an empty picture name.
1143
        if ($delete) {

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

@@ 1879-1892 (lines=14) @@
1876
        $old_file = $path_info['file'];
1877
1878
        // Let us delete them.
1879
        if ($old_file != 'unknown.jpg') {
1880
            if (KEEP_THE_OLD_IMAGE_AFTER_CHANGE) {
1881
                $prefix = 'saved_'.date('Y_m_d_H_i_s').'_'.uniqid('').'_';
1882
                @rename($path.'small_'.$old_file, $path.$prefix.'small_'.$old_file);
1883
                @rename($path.'medium_'.$old_file, $path.$prefix.'medium_'.$old_file);
1884
                @rename($path.'big_'.$old_file, $path.$prefix.'big_'.$old_file);
1885
                @rename($path.$old_file, $path.$prefix.$old_file);
1886
            } else {
1887
                @unlink($path.'small_'.$old_file);
1888
                @unlink($path.'medium_'.$old_file);
1889
                @unlink($path.'big_'.$old_file);
1890
                @unlink($path.$old_file);
1891
            }
1892
        }
1893
1894
        // Exit if only deletion has been requested. Return an empty picture name.
1895
        if ($delete) {