Beispiel #1
0
def doPost(user):
    if not utils.check_csrf():
        return
    session['csrf_token'] = ""
    action = request.form.get("submitvalue")
    if action in actdict.keys():
        return actdict[action](user)
Beispiel #2
0
def doPost(user):
    if not utils.check_csrf():
        return
    session["csrf_token"] = ""
    action = request.form.get("submitvalue")
    if action in actdict.keys():
        actdict[action](user)
    flash("Account updated !", "success")
    return redirect(url_for("me"))
Beispiel #3
0
def doPost(login):
    if not utils.check_csrf():
        return
    session['csrf_token'] = ""
    password = request.form.get("password", None)
    pseudo = request.form.get("pseudo", None)
    if password:
        newpass = bcrypt.hashpw(str(password), bcrypt.gensalt(7))
        sql.addUser(dict(login=login,
                         realname=login, password=newpass))
        flash("User created !", "success")
        return True
    else:
        flash("Missing password !", "error")
        return False