Exemplo n.º 1
0
    def __init__(
        self,
        html_obj=None,
        req=None,
        resp=None,
        display_options=None,  # pylint: disable=redefined-outer-name
        prefix_logs_with_url: bool = True,
    ):
        self.html = html_obj
        self.auth_type = None
        self.display_options = display_options
        self.session: Optional["userdb.SessionInfo"] = None
        self.flashes: Optional[List[str]] = None
        self._prefix_logs_with_url = prefix_logs_with_url

        if req is None and html_obj:
            req = html_obj.request
        if resp is None and html_obj:
            resp = html_obj.response

        self.request = req
        self.response = resp
        # TODO: cyclical import with config -> globals -> config -> ...
        from cmk.gui.config import LoggedInNobody
        self.user = LoggedInNobody()

        self._prepend_url_filter = _PrependURLFilter()
        self._web_log_handler: Optional[logging.Handler] = None
Exemplo n.º 2
0
    def __init__(
        self,
        req: http.Request,
        resp: http.Response,
        funnel: OutputFunnel,
        html_obj: Optional[htmllib.html] = None,
        timeout_manager: Optional[TimeoutManager] = None,  # pylint: disable=redefined-outer-name
        theme: Optional[Theme] = None,  # pylint: disable=redefined-outer-name
        display_options: Optional[DisplayOptions] = None,  # pylint: disable=redefined-outer-name
        prefix_logs_with_url: bool = True,
    ):
        self.html = html_obj
        self.auth_type: Optional[str] = None
        self.timeout_manager = timeout_manager
        self.theme = theme
        self.display_options = display_options
        self.session: Optional[userdb.Session] = None
        self.flashes: Optional[List[str]] = None
        self._prefix_logs_with_url = prefix_logs_with_url

        self.request = req
        self.response = resp
        self.output_funnel = funnel

        self.transactions = TransactionManager(req)

        # TODO: cyclical import with config -> globals -> config -> ...
        from cmk.gui.config import LoggedInNobody
        self.user: config.LoggedInUser = LoggedInNobody()
        self.user_errors = UserErrors()

        self._prepend_url_filter = _PrependURLFilter()
        self._web_log_handler: Optional[logging.Handler] = None
Exemplo n.º 3
0
    def __init__(self, html_obj=None, req=None, resp=None):
        self.html = html_obj
        self.auth_type = None

        if req is None and html_obj:
            req = html_obj.request
        if resp is None and html_obj:
            resp = html_obj.response

        self.request = req
        self.response = resp
        # TODO: cyclical import with config -> globals -> config -> ...
        from cmk.gui.config import LoggedInNobody
        self.user = LoggedInNobody()
Exemplo n.º 4
0
    def __init__(self, html_obj=None, req=None, resp=None):
        self.html = html_obj
        self.auth_type = None
        self.session: Optional["userdb.SessionInfo"] = None
        self.flashes: Optional[List[str]] = None

        if req is None and html_obj:
            req = html_obj.request
        if resp is None and html_obj:
            resp = html_obj.response

        self.request = req
        self.response = resp
        # TODO: cyclical import with config -> globals -> config -> ...
        from cmk.gui.config import LoggedInNobody
        self.user = LoggedInNobody()
Exemplo n.º 5
0
 def __init__(self, html_obj):
     self.html = html_obj
     self.auth_type = None
     # TODO: cyclical import with config -> globals -> config -> ...
     from cmk.gui.config import LoggedInNobody
     self.user = LoggedInNobody()