Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 6220-6223 (lines=4) @@
6217
            'login_user_id = ? ' => $userId,
6218
        );
6219
6220
        if (!empty($from) && !empty($until)) {
6221
            $whereConditions["AND (login_date >= '?' "] = $from;
6222
            $whereConditions["AND logout_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
6223
        }
6224
6225
        $trackResult = Database::select(
6226
            'SEC_TO_TIME(SUM(UNIX_TIMESTAMP(logout_date) - UNIX_TIMESTAMP(login_date))) as total_time',

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

@@ 5287-5290 (lines=4) @@
5284
            'AND session_id = ? ' => $sessionId
5285
        );
5286
5287
        if (!empty($from) && !empty($until)) {
5288
            $whereConditions["AND (login_course_date >= '?' "] = $from;
5289
            $whereConditions["AND logout_course_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
5290
        }
5291
5292
        $trackResult = Database::select(
5293
            'SUM(UNIX_TIMESTAMP(logout_course_date) - UNIX_TIMESTAMP(login_course_date)) as total_time',