signup handling added

This commit is contained in:
gashapwn 2020-11-26 22:06:39 +00:00
parent 134ec10ab5
commit f682147507
3 changed files with 37 additions and 2 deletions

15
app.py
View File

@ -37,6 +37,7 @@ def widg_fun(widg):
return widg.w_type; return widg.w_type;
def req(): def req():
app.route('/req')
class Widg: class Widg:
def __init__(self, w_name, w_type, w_opt): def __init__(self, w_name, w_type, w_opt):
self.w_name = w_name self.w_name = w_name
@ -55,13 +56,23 @@ def req():
return render_template("req.html", req_tab = rt, widg_fun = widg_fun, page_name="req") return render_template("req.html", req_tab = rt, widg_fun = widg_fun, page_name="req")
def signup(): def signup():
app.route('/req/signup')
username = request.form["username"] username = request.form["username"]
email = request.form["email"] email = request.form["email"]
shell = request.form["shell"] shell = request.form["shell"]
rule_read = request.form["rule_read"] rule_read = request.form["rule_read"]
is_email_user = False;
if(rule_read != "on"): if(rule_read != "on"):
print("some fail condition") return redirect(url_for('req'))
if(len(email) > 1):
is_email_user = True
print(username + " " + email + " " + shell + " " + rule_read)
return render_template("signup.html", is_email_user = is_email_user)
def login(): def login():
@ -77,5 +88,5 @@ if __name__=="__main__":
app.add_url_rule('/success/<name>', 'success', success) app.add_url_rule('/success/<name>', 'success', success)
app.add_url_rule('/login', 'login', login, methods = ['POST', 'GET']) app.add_url_rule('/login', 'login', login, methods = ['POST', 'GET'])
app.add_url_rule('/req', 'req', req, methods = ['POST', 'GET']) app.add_url_rule('/req', 'req', req, methods = ['POST', 'GET'])
app.add_url_rule('/req/signup', 'req', req, methods = ['POST']) app.add_url_rule('/req/signup', 'signup', signup, methods = ['POST'])
app.run(host="104.248.118.130",debug=True) app.run(host="104.248.118.130",debug=True)

View File

@ -11,5 +11,8 @@
</div> </div>
</body> </body>
{% if page_name == "home" %}
<div style="min-height: 300px;"></div>
<footer>admin: <a href="email:gashapwn@protonmail.com">gashapwn@protonmail.com</a></footer> <footer>admin: <a href="email:gashapwn@protonmail.com">gashapwn@protonmail.com</a></footer>
{% endif %}
</html> </html>

21
templates/signup.html Normal file
View File

@ -0,0 +1,21 @@
{%extends "layout.html"%}
{%block content%}
<h3>submission successful</h3>
<p>
once your request is approved your account will be created
{% if is_email_user %}
and you will receive a confirmation email
</p>
{% else %}
you did not provide an emailn
to see if your account is ready, check the users list on the home page
this page will be updated with your username once approved
</p>
{% endif %}
<p>
if you have questions, email gashapwn@protonmail.com
or DM gashapwn on IRC at irc.lainchan.org
<p>
{%endblock%}