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")