all features planned working
This commit is contained in:
parent
90a5491b06
commit
ddb6f4c82d
29
app.py
29
app.py
|
@ -278,14 +278,27 @@ def delete_alias():
|
||||||
redirect('/')
|
redirect('/')
|
||||||
|
|
||||||
|
|
||||||
#@post('/delete')
|
@post('/delete')
|
||||||
#def delete_account():
|
def delete_account():
|
||||||
# username = logged_in()
|
username = logged_in()
|
||||||
# password = #from form
|
password = request.forms.get('password')
|
||||||
# if miab_auth(username, password):
|
if username:
|
||||||
# #do the actual delete
|
if miab_auth(username, password):
|
||||||
# else:
|
data = { "email": username, }
|
||||||
# #render default and send flash error message
|
d = requests.post(miab_url + "/mail/users/remove", data=data, auth=(miab_admin, miab_passwd))
|
||||||
|
if d.status_code == 200:
|
||||||
|
message = { "message": "Your account has been deleted successfully", "alert": "success" }
|
||||||
|
response.set_cookie(cookie_name + "_message", message, secret=cookie_secret, max_age=5, path="/")
|
||||||
|
response.delete_cookie(cookie_name)
|
||||||
|
redirect('/')
|
||||||
|
else:
|
||||||
|
message = { "message": "Something went wrong deleting your account", "alert": "danger" }
|
||||||
|
response.set_cookie(cookie_name + "_message", message, secret=cookie_secret, max_age=5, path="/")
|
||||||
|
redirect('/')
|
||||||
|
else:
|
||||||
|
message = { "message": "Your supplied password is wrong", "alert": "danger" }
|
||||||
|
response.set_cookie(cookie_name + "_message", message, secret=cookie_secret, max_age=5, path="/")
|
||||||
|
redirect('/')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,28 +21,6 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<!--<nav class="navbar navbar-inverse navbar-fixed-top">
|
|
||||||
<div class="container">
|
|
||||||
<div class="navbar-header">
|
|
||||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
|
||||||
<span class="sr-only">Toggle navigation</span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
</button>
|
|
||||||
<a class="navbar-brand" href="#">{{ app_name }}</a>
|
|
||||||
</div>
|
|
||||||
<div id="navbar" class="collapse navbar-collapse">
|
|
||||||
<ul class="nav navbar-nav">
|
|
||||||
<li class="active"><a href="#">Profile</a></li>
|
|
||||||
<li><a href="#users">Aliases</a></li>
|
|
||||||
<li><a href="#mail">Name records</a></li>
|
|
||||||
<li><a href=""></a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>-->
|
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
%if message:
|
%if message:
|
||||||
<div class="alert alert-{{ message['alert'] }} alert-dismissible" role="alert">
|
<div class="alert alert-{{ message['alert'] }} alert-dismissible" role="alert">
|
||||||
|
@ -71,18 +49,17 @@
|
||||||
<button type="submit" class="btn btn-primary">change</button>
|
<button type="submit" class="btn btn-primary">change</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="starter-template">
|
<div class="starter-template">
|
||||||
<h2>Manage aliases</h2>
|
<h2>Manage aliases</h2>
|
||||||
<hr>
|
<hr>
|
||||||
<p>Aliases are additional email addresses which will be forwarded to your account.
|
<p>
|
||||||
Besides your primary email address you can use an alias to send your emails.<br>
|
Aliases are additional email addresses which will be forwarded to your account.
|
||||||
<small>Available domains: <b>@aundas.org</b>, <b>@socialnerds.org</b>,
|
Besides your primary email address you can use an alias to send your emails.<br>
|
||||||
<b>@phlo.at</b>, <b>@gmur.ml</b>, <b>@socialg.it</b><br>
|
<small>Available domains: <b>@aundas.org</b>, <b>@socialnerds.org</b>,
|
||||||
Be aware the limit of {{ max_aliases }} active aliases.</small>
|
<b>@phlo.at</b>, <b>@gmur.ml</b>, <b>@socialg.it</b><br>
|
||||||
|
Be aware the limit of {{ max_aliases }} active aliases.</small>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
%for alias in aliases:
|
%for alias in aliases:
|
||||||
|
@ -96,6 +73,7 @@
|
||||||
</form>
|
</form>
|
||||||
</p>
|
</p>
|
||||||
%end
|
%end
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<form class="form-inline" action="/alias/add", method="post">
|
<form class="form-inline" action="/alias/add", method="post">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
@ -108,29 +86,28 @@
|
||||||
%end
|
%end
|
||||||
</form>
|
</form>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="starter-template">
|
<div class="starter-template">
|
||||||
<h2>Delete account</h2>
|
<h2>Delete account</h2>
|
||||||
<hr>
|
<hr>
|
||||||
<p>Entering your password and hitting the delete button will render your <a href="https://socialnerds.org/account">SocialNerds account</a> unavailable and <b>remove all data from your servers</b>.<br><small>The actual removal will happen within a week.</small></p>
|
<p>
|
||||||
|
Entering your password and hitting the delete button will render your
|
||||||
|
<a href="https://socialnerds.org/account">SocialNerds account</a>
|
||||||
|
unavailable and <b>remove all data from your servers</b>.<br>
|
||||||
|
<small>The actual removal will happen within a week.</small>
|
||||||
|
</p>
|
||||||
|
|
||||||
<form class="form-inline">
|
<form class="form-inline" action="/delete", method="post">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input name="password" type="password" class="form-control" id="deleteaccountInput" placeholder="Password">
|
<input name="password" type="password" class="form-control" id="deleteaccountInput" placeholder="Password">
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-danger">delete</button>
|
<button type="submit" class="btn btn-danger">delete</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div><!-- /.container -->
|
</div><!-- /.container -->
|
||||||
|
|
||||||
|
|
||||||
<!-- Bootstrap core JavaScript
|
<!-- Bootstrap core JavaScript
|
||||||
================================================== -->
|
================================================== -->
|
||||||
<!-- Placed at the end of the document so the pages load faster -->
|
<!-- Placed at the end of the document so the pages load faster -->
|
||||||
|
|
Reference in New Issue