Code Duplication    Length = 5-5 lines in 2 locations

main/webservices/webservice_user.php 2 locations

@@ 284-288 (lines=5) @@
281
        if ($user_id_field_name != "chamilo_user_id") {
282
            $extras_associative[$user_id_field_name] = $user_id_value;
283
        }
284
        if (!empty($extras)) {
285
            foreach ($extras as $extra) {
286
                $extras_associative[$extra['field_name']] = $extra['field_value'];
287
            }
288
        }
289
        $result = UserManager::create_user(
290
            $firstname,
291
            $lastname,
@@ 558-562 (lines=5) @@
555
            $this->handleError($verifKey);
556
        } else {
557
            $extras_associative = array();
558
            if (!empty($extras)) {
559
                foreach ($extras as $extra) {
560
                    $extras_associative[$extra['field_name']] = $extra['field_value'];
561
                }
562
            }
563
564
            $result = $this->editUserHelper(
565
                $user_id_field_name,