Add the ability to view IP addresses in auth, with a basic search interface

This commit is contained in:
2012-03-29 22:51:58 +01:00
parent 150a6503c6
commit 45630f10f7
4 changed files with 58 additions and 3 deletions

View File

@@ -19,6 +19,9 @@
{% if "hr"|installed %}
<li><b>Blacklist Status: {% if blacklisted %}<font color='red'>BLACKLISTED</font> ({{ blacklisted }} items){% else %}<font color='geen'>OK</font>{% endif %}</b></li>
{% endif %}
{% if user.ip_addresses.count %}
<li><a href="{% url sso-ipaddress %}?user={{ user.username }}">IP Address Lookup</a> ({{ user.ip_addresses.count }} associated addresses)</li>
{% endif %}
</p>
<p>

View File

@@ -0,0 +1,25 @@
{% extends "base.html" %}
{% block title %}IP Search: {% if kuser %}{{ kuser }}{% else %}{{ ip }}{% endif %}{% endblock %}
{% block content %}
<h1>IP Search: {% if kuser %}{{ kuser }}{% else %}{{ ip }}{% endif %}</h1>
{% if object_list %}
<table>
<thead>
<tr><th>IP Address</th><th>User</th><th>First Use</th><th>Last Use</th></tr>
</thead>
<tbody>
{% for object in object_list %}
<tr><td><a href="{% url sso-ipaddress %}?ip={{ object.ip_address }}">{{ object.ip_address }}</a></td>
<td><a href="{% url sso-ipaddress %}?user={{ object.user.username }}">{{ object.user }}</a> (<a href="{% url sso-viewuser object.user.username %}">Profile</a>)</td>
<td>{{ object.first_seen }}</td>
<td>{{ object.last_seen }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}