mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 22:44:24 +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
|
- 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 issue where the current theme cannot be found in list of themes
|
||||||
- Fix page preview so that it accounts for the provided format
|
- 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**
|
**API**
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<td class="text-center"><b>User</b></td>
|
<td class="text-center"><b>User</b></td>
|
||||||
<td class="text-center"><b>IP Address</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>Last Seen</b></td>
|
||||||
|
<td class="text-center"><b>City</b></td>
|
||||||
<td class="text-center"><b>Country</b></td>
|
<td class="text-center"><b>Country</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -17,24 +18,32 @@
|
|||||||
{{ addr.user.name }}
|
{{ addr.user.name }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<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">
|
<td class="text-center solve-time">
|
||||||
<span data-time="{{ addr.date | isoformat }}"></span>
|
<span data-time="{{ addr.date | isoformat }}"></span>
|
||||||
</td>
|
</td>
|
||||||
{% set country = lookup_ip_address(addr.ip) %}
|
{% set city = lookup_ip_address_city(addr.ip) %}
|
||||||
{% if country %}
|
|
||||||
<td class="text-center">
|
<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>
|
<i class="flag-{{ country.lower() }}"></i>
|
||||||
|
|
||||||
{{ lookup_country_code(country) }}
|
{{ lookup_country_code(country) }}
|
||||||
</td>
|
|
||||||
{% else %}
|
|
||||||
<td class="text-center">
|
|
||||||
</td>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<small class="float-right">
|
||||||
|
<a class="text-muted" href='https://db-ip.com'>IP Geolocation by DB-IP</a>
|
||||||
|
</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,11 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{% for addr in addrs %}
|
{% for addr in addrs %}
|
||||||
<tr>
|
<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">
|
<td class="text-center solve-time">
|
||||||
<span data-time="{{ addr.date | isoformat }}"></span>
|
<span data-time="{{ addr.date | isoformat }}"></span>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user