You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
haproxy-wi/app/waf.py

26 lines
697 B

6 years ago
#!/usr/bin/env python3
import funct
import sql
from jinja2 import Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('templates/'), autoescape=True)
6 years ago
template = env.get_template('waf.html')
print('Content-type: text/html\n')
funct.check_login()
6 years ago
funct.page_for_admin(level = 2)
6 years ago
try:
user, user_id, role, token, servers = funct.get_users_params()
6 years ago
except:
pass
6 years ago
template = template.render(h2 = 1, title = "Web application firewall",
autorefresh = 1,
role = role,
6 years ago
user = user,
5 years ago
servers = sql.select_waf_servers_metrics(user_id.value),
servers_all = servers,
versions = funct.versions(),
6 years ago
token = token)
print(template)