Code Duplication    Length = 4-8 lines in 3 locations

main/work/work.lib.php 1 location

@@ 454-461 (lines=8) @@
451
    $groupId = intval($groupId);
452
    $studentCondition = null;
453
454
    if (!empty($onlyUserList)) {
455
        $onlyUserList = array_map('intval', $onlyUserList);
456
        $studentCondition = "AND u.user_id IN ('".implode("', '", $onlyUserList)."') ";
457
    } else {
458
        if (empty($userId)) {
459
            return 0;
460
        }
461
    }
462
463
    $groupIid = 0;
464
    if ($groupId) {

src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php 1 location

@@ 1188-1191 (lines=4) @@
1185
                    WHERE c_id = '.$courseId.' AND (session_id = 0 OR session_id IS NULL)';
1186
        }
1187
1188
        if (!empty($id_list)) {
1189
            $id_list = array_map('intval', $id_list);
1190
            $sql .= " AND id IN (".implode(', ', $id_list).") ";
1191
        }
1192
1193
        $db_result = Database::query($sql);
1194
        if ($db_result) {

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

@@ 1515-1519 (lines=5) @@
1512
            }
1513
        }
1514
1515
        if (!empty($userIdList)) {
1516
            $userIdList = array_map('intval', $userIdList);
1517
            $userIdList = implode('","', $userIdList);
1518
            $sql .= ' AND user.id IN ("' . $userIdList . '")';
1519
        }
1520
1521
        if (isset($filterByActive)) {
1522
            $filterByActive = intval($filterByActive);