Code Duplication    Length = 10-10 lines in 2 locations

main/cron/import_csv.php 2 locations

@@ 494-503 (lines=10) @@
491
                    );
492
493
                    if ($result) {
494
                        foreach ($row as $key => $value) {
495
                            if (substr($key, 0, 6) == 'extra_') {
496
                                //an extra field
497
                                UserManager::update_extra_field_value(
498
                                    $userInfo['user_id'],
499
                                    substr($key, 6),
500
                                    $value
501
                                );
502
                            }
503
                        }
504
                        $this->logger->addInfo("Teachers - User updated: ".$row['username']);
505
                    } else {
506
                        $this->logger->addError("Teachers - User not updated: ".$row['username']);
@@ 715-724 (lines=10) @@
712
                        if ($row['username'] != $userInfo['username']) {
713
                            $this->logger->addInfo("Students - Username was changes from '".$userInfo['username']."' to '".$row['username']."' ");
714
                        }
715
                        foreach ($row as $key => $value) {
716
                            if (substr($key, 0, 6) === 'extra_') {
717
                                //an extra field
718
                                UserManager::update_extra_field_value(
719
                                    $userInfo['user_id'],
720
                                    substr($key, 6),
721
                                    $value
722
                                );
723
                            }
724
                        }
725
726
                        $this->logger->addInfo("Students - User updated: ".$row['username']);
727
                    } else {