listusers thing

This commit is contained in:
maaa 2023-07-22 18:23:52 +02:00
parent 37dfef84f5
commit 86492f6bea
1 changed files with 15 additions and 0 deletions

15
main
View File

@ -307,6 +307,21 @@ def apiremovenote():
else: else:
return {}, 422 return {}, 422
@app.route("/listusers/<secretkey>", methods=("GET", "POST"))
def listusers(secretkey):
if secretkey == SECRET_KEY:
conn = get_db_connection()
users = conn.execute("SELECT * FROM users").fetchall()
conn.close()
thing = ""
for x in users:
thing = str(x["id"]) + " - " + x["username"] + " - " + str(get_space(x["id"])) + "<br>" + thing
return thing
else:
return redirect("/")
@app.route("/api/logout") @app.route("/api/logout")
def apilogout(): def apilogout():
return render_template("logout.html") return render_template("logout.html")