public static function is_online($lastaccess) {
        global $CFG;

        // Variable to check if we consider this user online or not.
        $timetoshowusers = 300; // Seconds default.
        if (isset($CFG->block_online_users_timetosee)) {
            $timetoshowusers = $CFG->block_online_users_timetosee * 60;
        }
        $time = time() - $timetoshowusers;

        return $lastaccess >= $time;
    }
public static function is_online($lastaccess) {
        global $CFG;

        // Variable to check if we consider this user online or not.
        $timetoshowusers = 300; // Seconds default.
        if (isset($CFG->block_online_users_timetosee)) {
            $timetoshowusers = $CFG->block_online_users_timetosee * 60;
        }
        $time = time() - $timetoshowusers;

        return $lastaccess >= $time;
    }
public static function is_online ( $ lastaccess ) { global $ CFG ; // Variable to check if we consider this user online or not. $ timetoshowusers = 300 ; // Seconds default. if ( isset ( $ CFG -> block_online_users_timetosee ) ) { $ timetoshowusers = $ CFG -> block_online_users_timetosee * 60 ; } $ time = time ( ) - $ timetoshowusers ; return $ lastaccess >= $ time ; }
Helper function for checking the time meets the 'online' condition.

@param int $lastaccess
@return boolean
Helper function for checking the time meets the online condition .