Mercurial > prosody-modules
comparison mod_lastlog2/mod_lastlog2.lua @ 4103:ecc6ad057383
mod_lastlog2: Fix reporting of IP address (thanks Ge0rG)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 11 Sep 2020 16:48:28 +0200 |
parents | 4e7ff27c212c |
children | 7b722955c59b |
comparison
equal
deleted
inserted
replaced
4102:4e7ff27c212c | 4103:ecc6ad057383 |
---|---|
58 local lastlog = store:get(user); | 58 local lastlog = store:get(user); |
59 if lastlog then | 59 if lastlog then |
60 for event, data in pairs(lastlog) do | 60 for event, data in pairs(lastlog) do |
61 print(("Last %s: %s"):format(event, | 61 print(("Last %s: %s"):format(event, |
62 data.timestamp and os.date("%Y-%m-%d %H:%M:%S", data.timestamp) or "<unknown>")); | 62 data.timestamp and os.date("%Y-%m-%d %H:%M:%S", data.timestamp) or "<unknown>")); |
63 if lastlog.ip then | 63 if data.ip then |
64 print("IP address: "..lastlog.ip); | 64 print("IP address: "..data.ip); |
65 end | 65 end |
66 end | 66 end |
67 else | 67 else |
68 print("No record found"); | 68 print("No record found"); |
69 return 1; | 69 return 1; |