From 1ba7ccbf06154e2f6f68b59977ea50844fab0d4f Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sat, 12 Apr 2014 18:06:05 +0200 Subject: Removed option to disable a user. --- pyaggr3g470r/templates/admin/dashboard.html | 5 ----- pyaggr3g470r/views.py | 22 ---------------------- 2 files changed, 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 @@ - {% if user.apikey == "" %} - - {% else %} - - {% endif %} 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//', methods=['GET']) -@app.route('/admin/disable_user//', 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 -- cgit