equal
deleted
inserted
replaced
1 local jid = require"util.jid"; |
1 local jid = require"util.jid"; |
|
2 local st = require "util.stanza"; |
2 |
3 |
3 module:depends("audit"); |
4 module:depends("audit"); |
4 -- luacheck: read globals module.audit |
5 -- luacheck: read globals module.audit |
5 |
6 |
6 local only_passwords = module:get_option_boolean("audit_auth_passwords_only", true); |
7 local only_passwords = module:get_option_boolean("audit_auth_passwords_only", true); |
19 end |
20 end |
20 module:audit(jid.join(session.sasl_handler.username, module.host), "authentication-success", { |
21 module:audit(jid.join(session.sasl_handler.username, module.host), "authentication-success", { |
21 session = session, |
22 session = session, |
22 }); |
23 }); |
23 end) |
24 end) |
|
25 |
|
26 module:hook("client_management/new-client", function (event) |
|
27 local session, client = event.session, event.client; |
|
28 |
|
29 local client_info = st.stanza("client", { id = client.id }); |
|
30 if client.user_agent then |
|
31 client_info:text_tag("agent", client.user_agent); |
|
32 end |
|
33 if client.legacy then |
|
34 client_info:text_tag("legacy"); |
|
35 end |
|
36 |
|
37 module:audit(jid.join(session.username, module.host), "new-client", { |
|
38 session = session; |
|
39 custom = { |
|
40 }; |
|
41 }); |
|
42 end); |