diff --git a/auth.py b/auth.py index c0263cf..bc7725e 100644 --- a/auth.py +++ b/auth.py @@ -24,6 +24,9 @@ def get_session(request): return sessioninfo[0] + (sessionid,) +def check_pw(uid, password): + pass + @app.route("/auth/headerbar") def headerbar(): sessioninfo = get_session(request) diff --git a/main.py b/main.py index 40dac4a..9c935ee 100644 --- a/main.py +++ b/main.py @@ -20,11 +20,9 @@ def timestamp_filter(value): except: return value -# import sendmail import auth -# import dbcontroll -# import imageupload import entry +import user @app.route("/") def template(): diff --git a/static/css/main.scss b/static/css/main.scss index 1644b51..61fc4be 100644 --- a/static/css/main.scss +++ b/static/css/main.scss @@ -72,14 +72,6 @@ hr { display: flex; flex-direction: row; justify-content: space-between; - - // .headerbar-left { - // background-color: red; - // } - - // .headerbar-right { - // background-color: green; - // } } diff --git a/templates/auth/headerbar.html b/templates/auth/headerbar.html index 19e16d9..3077ab1 100644 --- a/templates/auth/headerbar.html +++ b/templates/auth/headerbar.html @@ -1,7 +1,7 @@
{% if loggedin %} - + {% else %} diff --git a/templates/user/delete.html b/templates/user/delete.html new file mode 100644 index 0000000..08db4a2 --- /dev/null +++ b/templates/user/delete.html @@ -0,0 +1,13 @@ +
+

Account dauerhaft löschen

+
+
+ + +
+ {% for r in responses %} + {{ r }}
+ {% endfor %} +
+
+
diff --git a/templates/user/userinfo.html b/templates/user/userinfo.html new file mode 100644 index 0000000..554baa9 --- /dev/null +++ b/templates/user/userinfo.html @@ -0,0 +1,10 @@ +{% extends "baseof.html" %} +{% block content %} + +Username: {{ username }}
+ID: {{ uid }}
+Profil erstellt: {{ created_at | timestamp }}
+ +
+ +{% endblock %} diff --git a/user.py b/user.py new file mode 100644 index 0000000..2e5c2d7 --- /dev/null +++ b/user.py @@ -0,0 +1,27 @@ +from flask import render_template, request, make_response, redirect +import database, re, bcrypt, secrets, time +from auth import get_session + +from app import app + +@app.route("/u/") +def userpage(username): + return "Page of " + username + +@app.route("/user/info") +def userinfo(): + sessioninfo = get_session(request) + + if not sessioninfo: + return "Melde dich an, um Einstellungen zu ändern!" + + uid = sessioninfo[0] + + userdata = database.fetch("SELECT created_at, last_login, username FROM user WHERE uid=?", [uid])[0] + + return render_template("user/userinfo.html", username=userdata[2], uid=uid, created_at=userdata[0]) + + +@app.route("/user/delete") +def userdelete(): + return render_template("user/delete.html")