Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 6542-6545 (lines=4) @@
6539
            'login_user_id = ? ' => $userId,
6540
        );
6541
6542
        if (!empty($from) && !empty($until)) {
6543
            $whereConditions["AND (login_date >= '?' "] = $from;
6544
            $whereConditions["AND logout_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
6545
        }
6546
6547
        $trackResult = Database::select(
6548
            'SEC_TO_TIME(SUM(UNIX_TIMESTAMP(logout_date) - UNIX_TIMESTAMP(login_date))) as total_time',

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

@@ 5106-5109 (lines=4) @@
5103
            'AND session_id = ? ' => $sessionId
5104
        );
5105
5106
        if (!empty($from) && !empty($until)) {
5107
            $whereConditions["AND (login_course_date >= '?' "] = $from;
5108
            $whereConditions["AND logout_course_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
5109
        }
5110
5111
        $trackResult = Database::select(
5112
            'SUM(UNIX_TIMESTAMP(logout_course_date) - UNIX_TIMESTAMP(login_course_date)) as total_time',