Code Duplication    Length = 5-8 lines in 2 locations

main/work/work.lib.php 1 location

@@ 499-506 (lines=8) @@
496
497
    $studentCondition = null;
498
499
    if (!empty($onlyUserList)) {
500
        $onlyUserList = array_map('intval', $onlyUserList);
501
        $studentCondition = "AND u.user_id IN ('".implode("', '", $onlyUserList)."') ";
502
    } else {
503
        if (empty($userId)) {
504
            return 0;
505
        }
506
    }
507
508
    $sql = "SELECT count(*) FROM (
509
                SELECT count(*), w.parent_id

main/inc/lib/course.lib.php 1 location

@@ 1386-1390 (lines=5) @@
1383
            }
1384
        }
1385
1386
        if (!empty($userIdList)) {
1387
            $userIdList = array_map('intval', $userIdList);
1388
            $userIdList = implode('","', $userIdList);
1389
            $sql .= ' AND user.user_id IN ("' . $userIdList . '")';
1390
        }
1391
1392
        if (isset($filterByActive)) {
1393
            $filterByActive = intval($filterByActive);