Code Duplication    Length = 14-14 lines in 3 locations

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

@@ 946-959 (lines=14) @@
943
        $old_file = $path_info['file'];
944
945
        // Let us delete them.
946
        if (!empty($old_file)) {
947
            if (KEEP_THE_OLD_IMAGE_AFTER_CHANGE) {
948
                $prefix = 'saved_'.date('Y_m_d_H_i_s').'_'.uniqid('').'_';
949
                @rename($path.'small_'.$old_file, $path.$prefix.'small_'.$old_file);
950
                @rename($path.'medium_'.$old_file, $path.$prefix.'medium_'.$old_file);
951
                @rename($path.'big_'.$old_file, $path.$prefix.'big_'.$old_file);
952
                @rename($path.$old_file, $path.$prefix.$old_file);
953
            } else {
954
                @unlink($path.'small_'.$old_file);
955
                @unlink($path.'medium_'.$old_file);
956
                @unlink($path.'big_'.$old_file);
957
                @unlink($path.$old_file);
958
            }
959
        }
960
961
        // Exit if only deletion has been requested. Return an empty picture name.
962
        if ($delete) {

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

@@ 1078-1091 (lines=14) @@
1075
        $old_file = $path_info['file'];
1076
1077
        // Let us delete them.
1078
        if (!empty($old_file)) {
1079
            if (KEEP_THE_OLD_IMAGE_AFTER_CHANGE) {
1080
                $prefix = 'saved_'.date('Y_m_d_H_i_s').'_'.uniqid('').'_';
1081
                @rename($path.'small_'.$old_file, $path.$prefix.'small_'.$old_file);
1082
                @rename($path.'medium_'.$old_file, $path.$prefix.'medium_'.$old_file);
1083
                @rename($path.'big_'.$old_file, $path.$prefix.'big_'.$old_file);
1084
                @rename($path.$old_file, $path.$prefix.$old_file);
1085
            } else {
1086
                @unlink($path.'small_'.$old_file);
1087
                @unlink($path.'medium_'.$old_file);
1088
                @unlink($path.'big_'.$old_file);
1089
                @unlink($path.$old_file);
1090
            }
1091
        }
1092
1093
        // Exit if only deletion has been requested. Return an empty picture name.
1094
        if ($delete) {

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

@@ 1595-1608 (lines=14) @@
1592
        $old_file = $path_info['file'];
1593
1594
        // Let us delete them.
1595
        if (!empty($old_file)) {
1596
            if (KEEP_THE_OLD_IMAGE_AFTER_CHANGE) {
1597
                $prefix = 'saved_'.date('Y_m_d_H_i_s').'_'.uniqid('').'_';
1598
                @rename($path.'small_'.$old_file, $path.$prefix.'small_'.$old_file);
1599
                @rename($path.'medium_'.$old_file, $path.$prefix.'medium_'.$old_file);
1600
                @rename($path.'big_'.$old_file, $path.$prefix.'big_'.$old_file);
1601
                @rename($path.$old_file, $path.$prefix.$old_file);
1602
            } else {
1603
                @unlink($path.'small_'.$old_file);
1604
                @unlink($path.'medium_'.$old_file);
1605
                @unlink($path.'big_'.$old_file);
1606
                @unlink($path.$old_file);
1607
            }
1608
        }
1609
1610
        // Exit if only deletion has been requested. Return an empty picture name.
1611
        if ($delete) {