diff --git a/frontend/website.py b/frontend/website.py index 793ed52..85cef6e 100644 --- a/frontend/website.py +++ b/frontend/website.py @@ -108,7 +108,7 @@ def confirmaccount(encoded_jwt): print(uname, pass_hashed) # create db entry - db.cur.execute("INSERT INTO user(email, pass_hashed, enabled) VALUES(?, ?, ?);", (uname, pass_hashed, True)) + db.cur.execute("INSERT INTO user(email, pass_hashed, enabled) VALUES(?, ?, ?);", (uname, pass_hashed, 1)) db.conn.commit() bottle.response.set_cookie("account", uname, secret) return bottle.redirect("/settings") @@ -126,6 +126,13 @@ def manage_bot(): else: bottle.abort(401, "Sorry, access denied.") +@app.route('/enable') +def enable(): + email = bottle.request.get_cookie("account", secret=secret) + db.cur.execute("MODIFY user.enabled = 1 WHERE email=?;", (email)) # :todo is this correct SQL? + db.conn.commit() + return bottle.static_file("../static/bot.html", root='../static') + @app.route('/static/') def static(filename): diff --git a/static/bot.html b/static/bot.html index 6de2ce1..0d2eb5b 100644 --- a/static/bot.html +++ b/static/bot.html @@ -1,12 +1,20 @@ Ticketfrei + + + + +

Ticketfrei

- # Is the user logged in? else, complain & show nothing. +
+ +
+