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

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

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

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