# HG changeset patch # User Kim Alvefur # Date 1492576612 -7200 # Node ID 8b21f13b08c5f762dfced80cd9963b09a484e43b # Parent 38c66b58b47063639b65d78d13f63332d1e24bd1 mod_log_auth: Split some long lines diff -r 38c66b58b470 -r 8b21f13b08c5 mod_log_auth/mod_log_auth.lua --- a/mod_log_auth/mod_log_auth.lua Tue Apr 18 04:12:51 2017 +0200 +++ b/mod_log_auth/mod_log_auth.lua Wed Apr 19 06:36:52 2017 +0200 @@ -1,9 +1,12 @@ local mode = module:get_option_string("log_auth_ips", "failure"); -assert(({ all = true, failure = true, success = true })[mode], "Unknown log mode: "..tostring(mode).." - valid modes are 'all', 'failure', 'success'"); +assert(({ all = true, failure = true, success = true })[mode], + "Unknown log mode: "..tostring(mode).." - valid modes are 'all', 'failure', 'success'"); if mode == "failure" or mode == "all" then module:hook("authentication-failure", function (event) - module:log("info", "Failed authentication attempt (%s) for user %s from IP: %s", event.condition or "unknown-condition", event.session.username or "?", event.session.ip or "?"); + local session = event.session; + module:log("info", "Failed authentication attempt (%s) for user %s from IP: %s", + event.condition or "unknown-condition", session.username or "?", session.ip or "?"); end); end