Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 6002-6005 (lines=4) @@
5999
            'login_user_id = ? ' => $userId,
6000
        );
6001
6002
        if (!empty($from) && !empty($until)) {
6003
            $whereConditions["AND (login_date >= '?' "] = $from;
6004
            $whereConditions["AND logout_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
6005
        }
6006
6007
        $trackResult = Database::select(
6008
            'SEC_TO_TIME(SUM(UNIX_TIMESTAMP(logout_date) - UNIX_TIMESTAMP(login_date))) as total_time',

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

@@ 4940-4943 (lines=4) @@
4937
            'AND session_id = ? ' => $sessionId
4938
        );
4939
4940
        if (!empty($from) && !empty($until)) {
4941
            $whereConditions["AND (login_course_date >= '?' "] = $from;
4942
            $whereConditions["AND logout_course_date <= DATE_ADD('?', INTERVAL 1 DAY)) "] = $until;
4943
        }
4944
4945
        $trackResult = Database::select(
4946
            'SUM(UNIX_TIMESTAMP(logout_course_date) - UNIX_TIMESTAMP(login_course_date)) as total_time',