mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Cleanup profile view
This commit is contained in:
15
sso/views.py
15
sso/views.py
@@ -37,21 +37,6 @@ def profile(request):
|
|||||||
profile = SSOUser(user=request.user)
|
profile = SSOUser(user=request.user)
|
||||||
profile.save()
|
profile.save()
|
||||||
|
|
||||||
try:
|
|
||||||
srvaccounts = ServiceAccount.objects.filter(user=request.user).all()
|
|
||||||
except ServiceAccount.DoesNotExist:
|
|
||||||
srvaccounts = None
|
|
||||||
|
|
||||||
try:
|
|
||||||
redditaccounts = RedditAccount.objects.filter(user=request.user).all()
|
|
||||||
except ServiceAccount.DoesNotExist:
|
|
||||||
redditaccounts = None
|
|
||||||
|
|
||||||
try:
|
|
||||||
eveaccounts = EVEAccount.objects.filter(user=request.user).all()
|
|
||||||
except EVEAccount.DoesNotExist:
|
|
||||||
eveaccounts = None
|
|
||||||
|
|
||||||
return render_to_response('sso/profile.html', locals(), context_instance=RequestContext(request))
|
return render_to_response('sso/profile.html', locals(), context_instance=RequestContext(request))
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
|||||||
@@ -17,17 +17,17 @@
|
|||||||
<p>To reset your External API Auth Services password, which is used to access tools and websites which use Auth's API, click the link below</p>
|
<p>To reset your External API Auth Services password, which is used to access tools and websites which use Auth's API, click the link below</p>
|
||||||
<p><a href="{% url sso.views.set_apipasswd %}">Reset External API Auth Services Password</a></p>
|
<p><a href="{% url sso.views.set_apipasswd %}">Reset External API Auth Services Password</a></p>
|
||||||
|
|
||||||
{% if eveaccounts %}
|
{% if user.eveaccount_set.all %}
|
||||||
<h2>External non-API Service Accounts</h2>
|
<h2>External non-API Service Accounts</h2>
|
||||||
<p>This is a list of all your current non-api external service accounts, to
|
<p>This is a list of all your current non-api external service accounts, to
|
||||||
create a login for a service click the Add Service link</p>
|
create a login for a service click the Add Service link</p>
|
||||||
{% if srvaccounts %}
|
{% if user.serviceaccount_set.all %}
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr><th>Service</th><th>Username</th><th>URL</th><th>Active</th><th>Actions</th></tr>
|
<tr><th>Service</th><th>Username</th><th>URL</th><th>Active</th><th>Actions</th></tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for acc in srvaccounts %}
|
{% for acc in user.serviceaccount_set.all %}
|
||||||
<tr><td>{{ acc.service }}</td>
|
<tr><td>{{ acc.service }}</td>
|
||||||
<td>{{ acc.service_uid }}</td>
|
<td>{{ acc.service_uid }}</td>
|
||||||
<td><a href="{{ acc.service.url }}">{{ acc.service.url }}</a></td>
|
<td><a href="{{ acc.service.url }}">{{ acc.service.url }}</a></td>
|
||||||
@@ -60,13 +60,13 @@ corporation. Limited keys are accepted for service validation. API keys
|
|||||||
are stored for on-going authentication. As the assigned owner of a key you may
|
are stored for on-going authentication. As the assigned owner of a key you may
|
||||||
remove them at any time, but this may affect any existing services you have
|
remove them at any time, but this may affect any existing services you have
|
||||||
setup.</p>
|
setup.</p>
|
||||||
{% if eveaccounts %}
|
{% if user.eveaccount_set.all %}
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr><th>User ID</th><th>API Key</th><th>Description</th><th>Type</th><th>Active</th><th>Last Updated</th><th>Actions</th></tr>
|
<tr><th>User ID</th><th>API Key</th><th>Description</th><th>Type</th><th>Active</th><th>Last Updated</th><th>Actions</th></tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for acc in eveaccounts %}
|
{% for acc in user.eveaccount_set.all %}
|
||||||
<tr><td>{{ acc.api_user_id }}</td>
|
<tr><td>{{ acc.api_user_id }}</td>
|
||||||
<td>{{ acc.api_key }}</td>
|
<td>{{ acc.api_key }}</td>
|
||||||
<td>{{ acc.description }}</td>
|
<td>{{ acc.description }}</td>
|
||||||
@@ -89,14 +89,14 @@ setup.</p>
|
|||||||
|
|
||||||
<h2>Reddit Accounts</h2>
|
<h2>Reddit Accounts</h2>
|
||||||
<p>This is a list of all your current linked Reddit accounts</p>
|
<p>This is a list of all your current linked Reddit accounts</p>
|
||||||
{% if redditaccounts %}
|
{% if user.redditaccount_set.all %}
|
||||||
<p>To validate your Reddit account, login on Reddit then click the link next to the account, fill in some text in the message and click send.</p>
|
<p>To validate your Reddit account, login on Reddit then click the link next to the account, fill in some text in the message and click send.</p>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr><th>Username</th><th>Created Date</th><th>Validated</th></tr>
|
<tr><th>Username</th><th>Created Date</th><th>Validated</th></tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for acc in redditaccounts %}
|
{% for acc in user.redditaccount_set.all %}
|
||||||
<tr><td>{{ acc.username }}</td>
|
<tr><td>{{ acc.username }}</td>
|
||||||
<td>{{ acc.date_created }}</td>
|
<td>{{ acc.date_created }}</td>
|
||||||
<td>{% if acc.validated %}Yes{% else %}No (<a href="http://www.reddit.com/message/compose/?to=DredditVerification&subject=Validation%3a%20{{user.username}}" target="_blank">Validate</a>){% endif %}</td>
|
<td>{% if acc.validated %}Yes{% else %}No (<a href="http://www.reddit.com/message/compose/?to=DredditVerification&subject=Validation%3a%20{{user.username}}" target="_blank">Validate</a>){% endif %}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user