mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Don't allow resets of Service Acccounts that don't need a password
This commit is contained in:
@@ -215,7 +215,8 @@ def service_reset(request, serviceid=0):
|
|||||||
except ServiceAccount.DoesNotExist:
|
except ServiceAccount.DoesNotExist:
|
||||||
return redirect('sso.views.profile')
|
return redirect('sso.views.profile')
|
||||||
|
|
||||||
if not acc.active:
|
# If the account is inactive, or the service doesn't require a password, redirect
|
||||||
|
if not acc.active or ('require_password' in acc.service.settings and not acc.service.settings['require_password']):
|
||||||
return redirect('sso.views.profile')
|
return redirect('sso.views.profile')
|
||||||
|
|
||||||
if acc.user == request.user:
|
if acc.user == request.user:
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ create a login for a service click the Add Service link</p>
|
|||||||
<td>{% if acc.active %}Yes{% else %}No{% endif %}</td>
|
<td>{% if acc.active %}Yes{% else %}No{% endif %}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if acc.active %}
|
{% if acc.active %}
|
||||||
<a href="{% url sso.views.service_reset acc.id %}">Reset</a> /
|
{% if acc.service.settings.require_password %}<a href="{% url sso.views.service_reset acc.id %}">Reset</a> / {% endif %}
|
||||||
<a href="{% url sso.views.service_del acc.id %}">Delete</a>
|
<a href="{% url sso.views.service_del acc.id %}">Delete</a>
|
||||||
{% if acc.service.provide_login %}
|
{% if acc.service.provide_login %}
|
||||||
/ <a href="{% url sso.views.service_login acc.id %}">Login</a>
|
/ <a href="{% url sso.views.service_login acc.id %}">Login</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user