diff options
-rw-r--r-- | pyaggr3g470r/templates/admin/dashboard.html | 5 | ||||
-rw-r--r-- | pyaggr3g470r/views.py | 22 |
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 |