diff --git a/app.py b/app.py index 78998ce..a940bf5 100644 --- a/app.py +++ b/app.py @@ -29,8 +29,10 @@ ACCOUNT_DIR = "req/"; FULL_PATH = str(WORKING_DIR) + str(ACCOUNT_DIR) CONF_PATH = str(WORKING_DIR) + "lyadmin.conf.json" +# validation stuff MAX_PUB_KEY_LEN = 5000 - +EMAIL_REGEX = "^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,10}$" +KEY_REGEX = "^[ -~]+$" # Account requests are given ID numbers # the first request will have the below @@ -42,7 +44,7 @@ with open(CONF_PATH) as c: conf_json_str = c.read() conf_obj = json.loads(conf_json_str) # A list of all the shell enums -conf_obj.shell_tup_list = list(map( +conf_obj["shell_tup_list"] = list(map( lambda k : ( k, conf_obj["shell"][k] ), @@ -63,22 +65,23 @@ def home(): return render_template("index.html", u_list=u_list, page_name="home") - -# The page with rules +# Generates the page with rule. No logic needed. def rules(): return render_template("rules.html") # Generate HTML for a form widget def widg_fun(widg): if(widg.w_type == "input"): - # Return HTML for a single line input - return "input id=id_%s name=%s type=text>