Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 6428-6431 (lines=4) @@
6425
            'login_user_id = ? ' => $userId,
6426
        );
6427
6428
        if (!empty($from) && !empty($until)) {
6429
            $whereConditions["AND (login_date >= '?' "] = $from;
6430
            $whereConditions["AND logout_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
6431
        }
6432
6433
        $trackResult = Database::select(
6434
            'SEC_TO_TIME(SUM(UNIX_TIMESTAMP(logout_date) - UNIX_TIMESTAMP(login_date))) as total_time',

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

@@ 5384-5387 (lines=4) @@
5381
            'AND session_id = ? ' => $sessionId
5382
        );
5383
5384
        if (!empty($from) && !empty($until)) {
5385
            $whereConditions["AND (login_course_date >= '?' "] = $from;
5386
            $whereConditions["AND logout_course_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
5387
        }
5388
5389
        $trackResult = Database::select(
5390
            'SUM(UNIX_TIMESTAMP(logout_course_date) - UNIX_TIMESTAMP(login_course_date)) as total_time',