Fix some bugs in track_users

This commit is contained in:
Gregory Soutade 2015-01-14 20:19:19 +01:00
parent 4e8a593699
commit e67723e58e

View File

@ -77,7 +77,7 @@ class IWLADisplayTrackUsers(IPlugin):
for ip in self.tracked_ip: for ip in self.tracked_ip:
if not ip in hits.keys(): continue if not ip in hits.keys(): continue
if 'dns_name_replaced' in hits[ip].keys(): if 'dns_name_replaced' in hits[ip].keys():
ip_title = '<b>%s [%s]</b>' % (ip, hits[ip][remote_addr]) ip_title = '<b>%s [%s]</b>' % (hits[ip]['remote_addr'], ip)
else: else:
ip_title = '<b>%s</b>' % (ip) ip_title = '<b>%s</b>' % (ip)
table.appendRow([ip_title, '']) table.appendRow([ip_title, ''])
@ -107,6 +107,8 @@ class IWLADisplayTrackUsers(IPlugin):
for ip in self.tracked_ip: for ip in self.tracked_ip:
if not ip in hits.keys(): continue if not ip in hits.keys(): continue
if 'dns_name_replaced' in hits[ip].keys(): if 'dns_name_replaced' in hits[ip].keys():
ip = '%s [%s]' % (ip, hits[ip][remote_addr]) ip_title = '%s [%s]' % (hits[ip]['remote_addr'], ip)
table.appendRow([ip, time.asctime(hits[ip]['last_access'])]) else:
ip_title = ip
table.appendRow([ip_title, time.asctime(hits[ip]['last_access'])])
index.appendBlock(table) index.appendBlock(table)