aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-12 18:06:05 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-12 18:06:05 +0200
commit1ba7ccbf06154e2f6f68b59977ea50844fab0d4f (patch)
tree6467abd2ea6ec3fe00a3d761a8cf4a0e78dfa8e3
parentBug fix in the /inactives template. (diff)
downloadnewspipe-1ba7ccbf06154e2f6f68b59977ea50844fab0d4f.tar.gz
newspipe-1ba7ccbf06154e2f6f68b59977ea50844fab0d4f.tar.bz2
newspipe-1ba7ccbf06154e2f6f68b59977ea50844fab0d4f.zip
Removed option to disable a user.
-rw-r--r--pyaggr3g470r/templates/admin/dashboard.html5
-rw-r--r--pyaggr3g470r/views.py22
2 files changed, 0 insertions, 27 deletions
diff --git a/pyaggr3g470r/templates/admin/dashboard.html b/pyaggr3g470r/templates/admin/dashboard.html
index 2913d603..99f843f5 100644
--- a/pyaggr3g470r/templates/admin/dashboard.html
+++ b/pyaggr3g470r/templates/admin/dashboard.html
@@ -25,11 +25,6 @@
<td>
<a href="/admin/user/{{ user.id }}/"><i class="glyphicon glyphicon-user" title="View this user"></i></a>
<a href="/admin/edit_user/{{ user.id }}/"><i class="glyphicon glyphicon-edit" title="Edit this user"></i></a>
- {% if user.apikey == "" %}
- <a href="/admin/enable_user/{{ user.id }}/"><i class="glyphicon glyphicon-ok-circle" title="Enable API key of this user"></i></a>
- {% else %}
- <a href="/admin/disable_user/{{ user.id }}/"><i class="glyphicon glyphicon-ban-circle" title="Disable API key of this user"></i></a>
- {% endif %}
<a href="/admin/delete_user/{{ user.id }}/"><i class="glyphicon glyphicon-remove" title="Delete this user"></i></a>
</td>
</tr>
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index 0e419dba..d0b410ee 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -647,25 +647,3 @@ def delete_user(user_id=None):
else:
flash('This user does not exist.', 'danger')
return redirect(redirect_url())
-
-@app.route('/admin/enable_user/<int:user_id>/', methods=['GET'])
-@app.route('/admin/disable_user/<int:user_id>/', methods=['GET'])
-@login_required
-@admin_permission.require()
-def disable_user(user_id=None):
- """
- Enable or disable the API key of a user.
- """
- user = User.query.filter(User.id == user_id).first()
- if user is not None:
- if user.apikey != "":
- user.pwdhash = ""
- flash(user.firstname + '" successfully disabled.', 'success')
- else:
- #import random, base64, hashlib
- user.pwdhash = "newpass"
- flash(user.firstname + '" successfully enabled.', 'success')
- db.session.commit()
- else:
- flash('This user does not exist.', 'danger')
- return redirect(redirect_url()) \ No newline at end of file
bgstack15