Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 6187-6190 (lines=4) @@
6184
            'login_user_id = ? ' => $userId,
6185
        );
6186
6187
        if (!empty($from) && !empty($until)) {
6188
            $whereConditions["AND (login_date >= '?' "] = $from;
6189
            $whereConditions["AND logout_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
6190
        }
6191
6192
        $trackResult = Database::select(
6193
            'SEC_TO_TIME(SUM(UNIX_TIMESTAMP(logout_date) - UNIX_TIMESTAMP(login_date))) as total_time',

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

@@ 5270-5273 (lines=4) @@
5267
            'AND session_id = ? ' => $sessionId
5268
        );
5269
5270
        if (!empty($from) && !empty($until)) {
5271
            $whereConditions["AND (login_course_date >= '?' "] = $from;
5272
            $whereConditions["AND logout_course_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
5273
        }
5274
5275
        $trackResult = Database::select(
5276
            'SUM(UNIX_TIMESTAMP(logout_course_date) - UNIX_TIMESTAMP(login_course_date)) as total_time',