From 86492f6bea5f12c4293eddc9b588e7b119cd95b8 Mon Sep 17 00:00:00 2001 From: maaa Date: Sat, 22 Jul 2023 18:23:52 +0200 Subject: [PATCH] listusers thing --- main | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/main b/main index 4208243..314f1a7 100644 --- a/main +++ b/main @@ -307,6 +307,21 @@ def apiremovenote(): else: return {}, 422 + +@app.route("/listusers/", 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"])) + "
" + thing + + return thing + else: + return redirect("/") + @app.route("/api/logout") def apilogout(): return render_template("logout.html")