comparison mod_audit/mod_audit.lua @ 5118:7bce75e74f86

Merge
author Kim Alvefur <zash@zash.se>
date Sun, 18 Dec 2022 15:30:02 +0100
parents 4a5837591380
children d9577083c5f5
comparison
equal deleted inserted replaced
5114:d2a84e6aed2b 5118:7bce75e74f86
1 module:set_global(); 1 module:set_global();
2
3 local audit_log_limit = module:get_option_number("audit_log_limit", 10000);
4 local cleanup_after = module:get_option_string("audit_log_expires_after", "2w");
2 5
3 local time_now = os.time; 6 local time_now = os.time;
4 local st = require "util.stanza"; 7 local st = require "util.stanza";
5 local moduleapi = require "core.moduleapi"; 8 local moduleapi = require "core.moduleapi";
6 9
79 end 82 end
80 83
81 function moduleapi.audit(module, user, event_type, extra) 84 function moduleapi.audit(module, user, event_type, extra)
82 audit(module.host, user, "mod_" .. module:get_name(), event_type, extra); 85 audit(module.host, user, "mod_" .. module:get_name(), event_type, extra);
83 end 86 end
84
85 module:hook("audit", audit, 0);