code: public static boolean isCmsOnlineRequest(ServletRequest req) {
  
          if (req == null) {
              return false;
          }
          return getController(req).getCmsObject().getRequestContext().getCurrentProject().isOnlineProject();
      }
docs: Checks if the provided request is running in OpenCms and the current users project is the online project.<p>
  
  @param req the current request
  
  @return <code>true</code> if the request is running in OpenCms and the current users project is
  the online project, <code>false</code> otherwise