Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 6242-6245 (lines=4) @@
6239
            'login_user_id = ? ' => $userId,
6240
        );
6241
6242
        if (!empty($from) && !empty($until)) {
6243
            $whereConditions["AND (login_date >= '?' "] = $from;
6244
            $whereConditions["AND logout_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
6245
        }
6246
6247
        $trackResult = Database::select(
6248
            'SEC_TO_TIME(SUM(UNIX_TIMESTAMP(logout_date) - UNIX_TIMESTAMP(login_date))) as total_time',

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

@@ 5294-5297 (lines=4) @@
5291
            'AND session_id = ? ' => $sessionId
5292
        );
5293
5294
        if (!empty($from) && !empty($until)) {
5295
            $whereConditions["AND (login_course_date >= '?' "] = $from;
5296
            $whereConditions["AND logout_course_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
5297
        }
5298
5299
        $trackResult = Database::select(
5300
            'SUM(UNIX_TIMESTAMP(logout_course_date) - UNIX_TIMESTAMP(login_course_date)) as total_time',