Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 5303-5306 (lines=4) @@
5300
            'AND session_id = ? ' => $sessionId
5301
        );
5302
5303
        if (!empty($from) && !empty($until)) {
5304
            $whereConditions["AND (login_course_date >= '?' "] = $from;
5305
            $whereConditions["AND logout_course_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
5306
        }
5307
5308
        $trackResult = Database::select(
5309
            'SUM(UNIX_TIMESTAMP(logout_course_date) - UNIX_TIMESTAMP(login_course_date)) as total_time',

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

@@ 6306-6309 (lines=4) @@
6303
            'login_user_id = ? ' => $userId,
6304
        );
6305
6306
        if (!empty($from) && !empty($until)) {
6307
            $whereConditions["AND (login_date >= '?' "] = $from;
6308
            $whereConditions["AND logout_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
6309
        }
6310
6311
        $trackResult = Database::select(
6312
            'SEC_TO_TIME(SUM(UNIX_TIMESTAMP(logout_date) - UNIX_TIMESTAMP(login_date))) as total_time',