Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 5993-5996 (lines=4) @@
5990
            'login_user_id = ? ' => $userId,
5991
        );
5992
5993
        if (!empty($from) && !empty($until)) {
5994
            $whereConditions["AND (login_date >= '?' "] = $from;
5995
            $whereConditions["AND logout_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
5996
        }
5997
5998
        $trackResult = Database::select(
5999
            'SEC_TO_TIME(SUM(UNIX_TIMESTAMP(logout_date) - UNIX_TIMESTAMP(login_date))) as total_time',

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

@@ 4928-4931 (lines=4) @@
4925
            'AND session_id = ? ' => $sessionId
4926
        );
4927
4928
        if (!empty($from) && !empty($until)) {
4929
            $whereConditions["AND (login_course_date >= '?' "] = $from;
4930
            $whereConditions["AND logout_course_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
4931
        }
4932
4933
        $trackResult = Database::select(
4934
            'SUM(UNIX_TIMESTAMP(logout_course_date) - UNIX_TIMESTAMP(login_course_date)) as total_time',