Get GEO code for all visits (not only valid ones)
This commit is contained in:
		| @@ -69,10 +69,10 @@ class IWLADisplayTopGeo(IPlugin): | ||||
|     def FlagFilter(host, self): | ||||
|         cc = None | ||||
|         host_name = host.split(' ')[0] # hostname or ip | ||||
|         if host_name in self.valid_visitors.keys(): | ||||
|             cc = self.valid_visitors[host_name].get('country_code', None) | ||||
|         if host_name in self.visitors.keys(): | ||||
|             cc = self.visitors[host_name].get('country_code', None) | ||||
|         else: | ||||
|             for visitor in self.valid_visitors.values(): | ||||
|             for visitor in self.visitors.values(): | ||||
|                 if visitor['remote_addr'] == host_name: | ||||
|                     cc = visitor.get('country_code', None) | ||||
|                     break | ||||
| @@ -84,7 +84,7 @@ class IWLADisplayTopGeo(IPlugin): | ||||
|         display = self.iwla.getDisplay() | ||||
|         geo = self.iwla.getMonthStats().get('geo', {}) | ||||
|         geo = sorted(geo.items(), key=lambda t: t[1], reverse=True) | ||||
|         self.valid_visitors = self.iwla.getValidVisitors() | ||||
|         self.visitors = self.iwla.getCurrentVisits() | ||||
|  | ||||
|         # All in a page | ||||
|         if self.create_geo_page: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user