Code Duplication    Length = 13-14 lines in 2 locations

main/inc/lib/api.lib.php 2 locations

@@ 1470-1483 (lines=14) @@
1467
 * @return array $user_info array user_id, lastname, firstname, username, email
1468
 * @author Yannick Warnier <[email protected]>
1469
 */
1470
function api_get_user_info_from_username($username = '')
1471
{
1472
    if (empty($username)) {
1473
        return false;
1474
    }
1475
    $username = trim($username);
1476
1477
1478
    $user = UserManager::getManager()->findUserByUsername($username);
1479
    if ($user) {
1480
        return _api_format_user($user);
1481
    }
1482
    return false;
1483
}
1484
1485
/**
1486
 * Get first user with an email
@@ 1490-1502 (lines=13) @@
1487
 * @param string $email
1488
 * @return array|bool
1489
 */
1490
function api_get_user_info_from_email($email)
1491
{
1492
    if (empty($email)) {
1493
        return false;
1494
    }
1495
1496
    $user = UserManager::getManager()->findUserByEmail($email);
1497
    if ($user) {
1498
        return _api_format_user($user);
1499
    }
1500
1501
    return false;
1502
}
1503
1504
/**
1505
 * @return string