mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-17 11:49:29 +00:00
Added gargoyle switch to enable key deletion
This commit is contained in:
@@ -133,6 +133,11 @@ GARGOYLE_SWITCH_DEFAULTS = {
|
|||||||
'label': 'EVE Test API Endpoints',
|
'label': 'EVE Test API Endpoints',
|
||||||
'description': 'Use the Test API endpoints instead of Live.',
|
'description': 'Use the Test API endpoints instead of Live.',
|
||||||
},
|
},
|
||||||
|
'eve-keydelete': {
|
||||||
|
'is_active': False,
|
||||||
|
'label': 'Allow EVE API Key Delete',
|
||||||
|
'description': 'Allows API keys to be deleted by th end user.',
|
||||||
|
},
|
||||||
'api-disableprocessing': {
|
'api-disableprocessing': {
|
||||||
'is_active': False,
|
'is_active': False,
|
||||||
'label': 'Disable API Backend Processing',
|
'label': 'Disable API Backend Processing',
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from eve_api import views
|
|||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
url(r'^eveapi/add/', views.eveapi_add, name="eveapi-add"),
|
url(r'^eveapi/add/', views.eveapi_add, name="eveapi-add"),
|
||||||
url(r'^eveapi/update/(?P<userid>\d+)/$', views.eveapi_update, name="eveapi-update"),
|
url(r'^eveapi/update/(?P<userid>\d+)/$', views.eveapi_update, name="eveapi-update"),
|
||||||
#url(r'^eveapi/delete/(?P<userid>\d+)/$', views.eveapi_del, name="eveapi-delete"),
|
url(r'^eveapi/delete/(?P<userid>\d+)/$', views.eveapi_del, name="eveapi-delete"),
|
||||||
url(r'^eveapi/refresh/(?P<userid>\d+)/$', views.eveapi_refresh, name="eveapi-refresh"),
|
url(r'^eveapi/refresh/(?P<userid>\d+)/$', views.eveapi_refresh, name="eveapi-refresh"),
|
||||||
url(r'^eveapi/log/(?P<userid>\d+)/$', views.eveapi_log, name="eveapi-log"),
|
url(r'^eveapi/log/(?P<userid>\d+)/$', views.eveapi_log, name="eveapi-log"),
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ def eveapi_update(request, userid, post_save_redirect='/', template='eve_api/upd
|
|||||||
def eveapi_del(request, userid, post_save_redirect='/'):
|
def eveapi_del(request, userid, post_save_redirect='/'):
|
||||||
""" Delete a EVE API key from a account """
|
""" Delete a EVE API key from a account """
|
||||||
|
|
||||||
|
if gargoyle.is_active('eve-keydelete'):
|
||||||
try:
|
try:
|
||||||
acc = EVEAccount.objects.get(pk=userid)
|
acc = EVEAccount.objects.get(pk=userid)
|
||||||
except EVEAccount.DoesNotExist:
|
except EVEAccount.DoesNotExist:
|
||||||
|
|||||||
@@ -114,7 +114,8 @@ setup.</p>
|
|||||||
<td id="api-time-{{ acc.api_user_id }}">{{ acc.api_last_updated|naturaltimediff }}</td>
|
<td id="api-time-{{ acc.api_user_id }}">{{ acc.api_last_updated|naturaltimediff }}</td>
|
||||||
<td>{% ifswitch api-disableprocessing %}{% else %}<a href="{% url eve_api.views.eveapi_refresh acc.api_user_id %}" onclick="javascript:refresh_apikey({{ acc.api_user_id }}); return false;">Refresh</a>,
|
<td>{% ifswitch api-disableprocessing %}{% else %}<a href="{% url eve_api.views.eveapi_refresh acc.api_user_id %}" onclick="javascript:refresh_apikey({{ acc.api_user_id }}); return false;">Refresh</a>,
|
||||||
<a href="{% url eve_api.views.eveapi_update acc.api_user_id %}">Update Key</a>, {% endifswitch %}
|
<a href="{% url eve_api.views.eveapi_update acc.api_user_id %}">Update Key</a>, {% endifswitch %}
|
||||||
<a href="{% url eve_api.views.eveapi_log acc.api_user_id %}">Logs</a>
|
<a href="{% url eve_api.views.eveapi_log acc.api_user_id %}">Logs</a>{% ifswitch eve-keydelete %},
|
||||||
|
<a href="{% url eve_api.views.eveapi_del acc.api_user_id %}">Delete</a>{% endifswitch %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user