changeset 5537:4b9a7684ae02

mod_firewall: marks: Fix marking a user with no previous marks
author Matthew Wild <mwild1@gmail.com>
date Thu, 08 Jun 2023 16:53:12 +0100
parents 96dec7681af8
children 40f8b9cc2065
files mod_firewall/actions.lib.lua
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mod_firewall/actions.lib.lua	Thu Jun 08 16:20:42 2023 +0100
+++ b/mod_firewall/actions.lib.lua	Thu Jun 08 16:53:12 2023 +0100
@@ -220,22 +220,20 @@
 end
 
 function action_handlers.MARK_USER(name)
-	return ([[if session.firewall_marks then
-			fire_event("firewall/marked/user", {
+	return ([[fire_event("firewall/marked/user", {
 				username = session.username;
 				mark = %q;
 				timestamp = current_timestamp;
 			});
-		end]]):format(idsafe(name)), { "timestamp" };
+		]]):format(idsafe(name)), { "timestamp" };
 end
 
 function action_handlers.UNMARK_USER(name)
-	return ([[if session.firewall_marks then
-			fire_event("firewall/unmarked/user", {
+	return ([[fire_event("firewall/unmarked/user", {
 				username = session.username;
 				mark = %q;
 			});
-		end]]):format(idsafe(name));
+		]]):format(idsafe(name));
 end
 
 function action_handlers.ADD_TO(spec)