def ports(saved=False): """the function returns the ports page when the user is logged in""" utils = Webutils() if utils.check_login() is True: payload = utils.get_default_payload("Ports") payload.tcp = utils.get_rule_list("tcp") payload.udp = utils.get_rule_list("udp") payload.custom = False if utils.get_rule_status("tcp") == "custom" or utils.get_rule_status( "udp") == "custom": payload.custom = True payload.saved = saved return render_template('ports.html', vars=payload) return login("", None)
def custom(saved=False): """the function returns the custom rules page when the user is logged in""" utils = Webutils() if utils.check_login() is True: payload = utils.get_default_payload("Custom") payload.rules = utils.get_rule_list("custom") payload.custom = utils.get_rule_status("custom") == "custom" payload.saved = saved return render_template('custom.html', vars=payload) return login("", None)