Beispiel #1
0
def apply(saved=False, step=1):
    """the function returns the apply page when the user is logged in"""
    utils = Webutils()
    if utils.check_login() is True:
        payload = utils.get_default_payload("Apply")
        payload.saved = saved
        payload.step = step
        payload.lastapplied = utils.get_last_accept_time()
        payload.running = utils.check_acceptance_running()
        payload.accepttime = utils.cfg.get_value("ACCEPTANCE", "time")
        return render_template(
            'apply.html', vars=payload)
    return login("", None)
Beispiel #2
0
def apply(saved: bool = False, step: int = 1) -> str:
    """
    the function returns the apply page when the user is logged in
    """
    utils = Webutils()
    if utils.check_login(request) is True:
        payload = utils.get_default_payload("Apply")
        payload.lead = """
            The defined firewall rules were not automatically activated for security reasons.<br>
            On this page, you can safely apply the defined rules.<br>
            The activation takes place in two steps and an exclusion from the server
            should be prevented.
            """
        payload.saved = saved
        payload.step = step
        payload.lastapplied = utils.get_last_accept_time()
        payload.running = step > 1
        payload.accepttime = str(
            utils.cfg_easywall.get_value("ACCEPTANCE", "duration"))
        return render_template('apply.html', vars=payload)
    return login()