original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Helper function for checking if we should show the user's online status.
  
  @param \stdClass $user
  @return boolean
docstring_tokens: Helper function for checking if we should show the user s online status .