mod_log_auth: Split some long lines

Wed, 19 Apr 2017 06:36:52 +0200

author
Kim Alvefur <zash@zash.se>
date
Wed, 19 Apr 2017 06:36:52 +0200
changeset 2695
8b21f13b08c5
parent 2694
38c66b58b470
child 2696
404d47d2e833

mod_log_auth: Split some long lines

mod_log_auth/mod_log_auth.lua file | annotate | diff | comparison | revisions
--- 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
 

mercurial