diff --git a/plugins/display/filter_users.py b/plugins/display/filter_users.py
index 219795f..bf06b64 100644
--- a/plugins/display/filter_users.py
+++ b/plugins/display/filter_users.py
@@ -74,23 +74,24 @@ class IWLADisplayFilterUsers(IPlugin):
path = self.iwla.getCurDisplayPath(filename)
page = display.createPage(title, path, self.iwla.getConfValue('css_path', []))
- table = display.createBlock(DisplayHTMLBlockTable, self.iwla._(u'Filtered users'), [self.iwla._(u'Pages'), self.iwla._(u'Last Access'), self.iwla._(u'User Agent'), self.iwla._(u'Referer')])
- table.setColsCSSClass(['iwla_page', '', '', ''])
+ table = display.createBlock(DisplayHTMLBlockTable, self.iwla._(u'Filtered users'), [self.iwla._(u'Pages'), self.iwla._(u'Last Access'), self.iwla._(u'User Agent'), self.iwla._(u'Referer'), self.iwla._(u'Location')])
+ table.setColsCSSClass(['iwla_page', '', '', '', ''])
row = 0
unknown = self.iwla._('Unknown')
for filtered_user in self.filtered_users:
ip = filtered_user['remote_ip']
ip_title = ip
location = filtered_user.get('geo_location', {})
- if location:
- city = location.get('city', unknown)
- country = location.get('countryname', unknown)
- if not city: city = unknown
- if not country: country = unknown
- # At least, one information
- if city != unknown or country != unknown:
- ip_title = f'{ip_title}
({city}/{country})'
- table.appendRow([f'{ip_title}', '', ''])
+ isp = location.get('isp', '')
+ str_location = ''
+ city = location.get('city', unknown)
+ country = location.get('countryname', unknown)
+ if location.get('city', '') or location.get('countryname'):
+ str_location = f'{city}/{country}'
+ if isp:
+ if str_location: str_location += '
'
+ str_location += isp
+ table.appendRow([f'{ip_title}', '', '', '', ''])
table.setCellCSSClass(row, 0, '')
for r in hits[ip]['requests'][::-1]:
uri = r['extract_request']['extract_uri'].lower()
@@ -105,7 +106,8 @@ class IWLADisplayFilterUsers(IPlugin):
referer = ''
uri = "%s%s" % (r.get('server_name', ''),
r['extract_request']['extract_uri'])
- table.appendRow([generateHTMLLink(uri), time.asctime(r['time_decoded']), r['http_user_agent'], referer], filtered_user['remote_ip'])
+ table.appendRow([generateHTMLLink(uri), time.asctime(r['time_decoded']), r['http_user_agent'], referer, str_location], filtered_user['remote_ip'])
+ str_location = ''
page.appendBlock(table)
display.addPage(page)