Пример #1
0
def login():
    if logged_in():
        return flask.redirect("/")

    if has_fields(flask.request.form, ["Username", "Password", "Method"]):

        if flask.request.form["Method"] == "Login":
            return verify_login_user(flask.request.form)
        elif flask.request.form["Method"] == "Register":
            return register_user(flask.request.form)

    return flask.render_template("user/login.html")
Пример #2
0
def login():
    if logged_in():
        return flask.redirect("/")

    if has_fields(flask.request.form, ["Username", "Password", "Method"]): 
        
        if flask.request.form["Method"] == "Login": 
            return verify_login_user(flask.request.form)
        elif flask.request.form["Method"] == "Register":
            return register_user(flask.request.form)
    
    return flask.render_template("user/login.html")
Пример #3
0
def frontpage():
    return flask.render_template("homepage/index.html", logged_in = logged_in())