public static function show_online_status($user) {
        global $CFG;

        require_once($CFG->dirroot . '/user/lib.php');

        if ($lastaccess = user_get_user_details($user, null, array('lastaccess'))) {
            if (isset($lastaccess['lastaccess'])) {
                return true;
            }
        }

        return false;
    }
public static function show_online_status($user) {
        global $CFG;

        require_once($CFG->dirroot . '/user/lib.php');

        if ($lastaccess = user_get_user_details($user, null, array('lastaccess'))) {
            if (isset($lastaccess['lastaccess'])) {
                return true;
            }
        }

        return false;
    }
public static function show_online_status ( $ user ) { global $ CFG ; require_once ( $ CFG -> dirroot . '/user/lib.php' ) ; if ( $ lastaccess = user_get_user_details ( $ user , null , array ( 'lastaccess' ) ) ) { if ( isset ( $ lastaccess [ 'lastaccess' ] ) ) { return true ; } } return false ; }
Helper function for checking if we should show the user's online status.

@param \stdClass $user
@return boolean
Helper function for checking if we should show the user s online status .