mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 14:34:21 +01:00
[Admin] Add a link on the IP modal to search for a given IP address accross all users. (#2113)
- Add links from User/Team Profile IP addresses to a User IP address search page - Add city geolocation to Team Profile IP addresses Co-authored-by: J <> Co-authored-by: Kevin Chung <kchung@nyu.edu> Co-authored-by: Kevin Chung <kchung@ctfd.io>
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
- Show admins the email server error message when email sending fails
|
||||
- Fix issue where the current theme cannot be found in list of themes
|
||||
- Fix page preview so that it accounts for the provided format
|
||||
- Add links from User/Team Profile IP addresses to a User IP address search page
|
||||
- Add city geolocation to Team Profile IP addresses
|
||||
|
||||
**API**
|
||||
|
||||
|
||||
@@ -1,40 +1,49 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center"><b>User</b></td>
|
||||
<td class="text-center"><b>IP Address</b></td>
|
||||
<td class="text-center"><b>Last Seen</b></td>
|
||||
<td class="text-center"><b>Country</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for addr in addrs %}
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<a href="{{ url_for("admin.users_detail", user_id=addr.user_id) }}">
|
||||
{{ addr.user.name }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">{{ addr.ip }}</td>
|
||||
<td class="text-center solve-time">
|
||||
<span data-time="{{ addr.date | isoformat }}"></span>
|
||||
</td>
|
||||
{% set country = lookup_ip_address(addr.ip) %}
|
||||
{% if country %}
|
||||
<td class="text-center">
|
||||
<i class="flag-{{ country.lower() }}"></i>
|
||||
|
||||
{{ lookup_country_code(country) }}
|
||||
</td>
|
||||
{% else %}
|
||||
<td class="text-center">
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center"><b>User</b></td>
|
||||
<td class="text-center"><b>IP Address</b></td>
|
||||
<td class="text-center"><b>Last Seen</b></td>
|
||||
<td class="text-center"><b>City</b></td>
|
||||
<td class="text-center"><b>Country</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for addr in addrs %}
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<a href="{{ url_for("admin.users_detail", user_id=addr.user_id) }}">
|
||||
{{ addr.user.name }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{{ url_for('admin.users_listing', field='ip', q=addr.ip) }}">
|
||||
{{ addr.ip }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center solve-time">
|
||||
<span data-time="{{ addr.date | isoformat }}"></span>
|
||||
</td>
|
||||
{% set city = lookup_ip_address_city(addr.ip) %}
|
||||
<td class="text-center">
|
||||
{% if city %}{{ city }}{% endif %}
|
||||
</td>
|
||||
{% set country = lookup_ip_address(addr.ip) %}
|
||||
<td class="text-center">
|
||||
{% if country %}
|
||||
<i class="flag-{{ country.lower() }}"></i>
|
||||
|
||||
{{ lookup_country_code(country) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<small class="float-right">
|
||||
<a class="text-muted" href='https://db-ip.com'>IP Geolocation by DB-IP</a>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,11 @@
|
||||
<tbody>
|
||||
{% for addr in addrs %}
|
||||
<tr>
|
||||
<td class="text-center">{{ addr.ip }}</td>
|
||||
<td class="text-center">
|
||||
<a href="{{ url_for('admin.users_listing', field='ip', q=addr.ip) }}">
|
||||
{{ addr.ip }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center solve-time">
|
||||
<span data-time="{{ addr.date | isoformat }}"></span>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user