def check_user(*args, **kwargs):
     (status, txt)=auth.check_user(u,p)
     if status==False:
         flash("you are not logged in")
         return render_template("login.html")
     else:
         return func(*args)
Пример #2
0
def login():
    if request.method=="GET":
        return render_template("login.html")

    u=request.form['username']
    p=request.form['password']
    (status,txt) = auth.check_user(u,p)
    if status==False:
        flash(txt)
        return render_template("login.html")
    else:
        session['username']=txt
				n = session.pop('nextpage','/')
        return redirect(n)
Пример #3
0
def login():
    if request.method == "GET":
        return render_template("login.html")

    u = request.form["username"]
    p = request.form["password"]
    (status, txt) = auth.check_user(u, p)
    if status == False:
        flash(txt)
        return render_template("login.html")
    else:
        session["username"] = txt
        if "nextpage" in session:
            n = session["nextpage"]
        else:
            n = "/"
        return redirect(n)