Code Duplication    Length = 21-21 lines in 2 locations

main/admin/user_import.php 1 location

@@ 267-287 (lines=21) @@
264
 * @param   string  $parser Deprecated?
265
 * @param   string  $data   The data to be parsed
266
 */
267
function element_end($parser, $data)
268
{
269
    $data = api_utf8_decode($data);
270
    global $user;
271
    global $users;
272
    global $current_value;
273
    switch ($data) {
274
        case 'Contact':
275
            if ($user['Status'] == '5') {
276
                $user['Status'] = STUDENT;
277
            }
278
            if ($user['Status'] == '1') {
279
                $user['Status'] = COURSEMANAGER;
280
            }
281
            $users[] = $user;
282
            break;
283
        default:
284
            $user[$data] = $current_value;
285
            break;
286
    }
287
}
288
289
/**
290
 * XML-parser: handle character data

main/admin/user_update_import.php 1 location

@@ 268-288 (lines=21) @@
265
 * @param   string  $parser Deprecated?
266
 * @param   string  $data   The data to be parsed
267
 */
268
function element_end($parser, $data)
269
{
270
    $data = api_utf8_decode($data);
271
    global $user;
272
    global $users;
273
    global $current_value;
274
    switch ($data) {
275
        case 'Contact':
276
            if ($user['Status'] == '5') {
277
                $user['Status'] = STUDENT;
278
            }
279
            if ($user['Status'] == '1') {
280
                $user['Status'] = COURSEMANAGER;
281
            }
282
            $users[] = $user;
283
            break;
284
        default:
285
            $user[$data] = $current_value;
286
            break;
287
    }
288
}
289
290
/**
291
 * XML-parser: handle character data