Code Duplication    Length = 10-10 lines in 2 locations

main/cron/import_csv.php 2 locations

@@ 550-559 (lines=10) @@
547
                    );
548
549
                    if ($result) {
550
                        foreach ($row as $key => $value) {
551
                            if (substr($key, 0, 6) == 'extra_') {
552
                                //an extra field
553
                                UserManager::update_extra_field_value(
554
                                    $userInfo['user_id'],
555
                                    substr($key, 6),
556
                                    $value
557
                                );
558
                            }
559
                        }
560
                        $this->logger->addInfo("Teachers - User updated: ".$row['username']);
561
                    } else {
562
                        $this->logger->addError("Teachers - User not updated: ".$row['username']);
@@ 774-783 (lines=10) @@
771
                        if ($row['username'] != $userInfo['username']) {
772
                            $this->logger->addInfo("Students - Username was changes from '".$userInfo['username']."' to '".$row['username']."' ");
773
                        }
774
                        foreach ($row as $key => $value) {
775
                            if (substr($key, 0, 6) === 'extra_') {
776
                                //an extra field
777
                                UserManager::update_extra_field_value(
778
                                    $userInfo['user_id'],
779
                                    substr($key, 6),
780
                                    $value
781
                                );
782
                            }
783
                        }
784
785
                        $this->logger->addInfo("Students - User updated: ".$row['username']);
786
                    } else {