changeset 2695:8b21f13b08c5

mod_log_auth: Split some long lines
author Kim Alvefur <zash@zash.se>
date Wed, 19 Apr 2017 06:36:52 +0200
parents 38c66b58b470
children 404d47d2e833
files mod_log_auth/mod_log_auth.lua
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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