comparison mod_firewall/conditions.lib.lua @ 6552:d4da95d6d977

mod_firewall: Fix DAY check for Sunday Lua refers to Sunday as day 1, not day 0. The other days of the week were correct, so this seems to have been a typo.
author Matthew Wild <mwild1@gmail.com>
date Sun, 24 May 2026 19:15:21 +0100
parents f61564e11d3b
children
comparison
equal deleted inserted replaced
6551:556d9584c65b 6552:d4da95d6d977
212 212
213 function condition_handlers.FROM_ROLE(role_name) 213 function condition_handlers.FROM_ROLE(role_name)
214 return ("sender_role and sender_role.name == %q"):format(role_name), { "sender_role" }; 214 return ("sender_role and sender_role.name == %q"):format(role_name), { "sender_role" };
215 end 215 end
216 216
217 local day_numbers = { sun = 0, mon = 2, tue = 3, wed = 4, thu = 5, fri = 6, sat = 7 }; 217 local day_numbers = { sun = 1, mon = 2, tue = 3, wed = 4, thu = 5, fri = 6, sat = 7 };
218 218
219 local function current_time_check(op, hour, minute) 219 local function current_time_check(op, hour, minute)
220 hour, minute = tonumber(hour), tonumber(minute); 220 hour, minute = tonumber(hour), tonumber(minute);
221 local adj_op = op == "<" and "<" or ">="; -- Start time inclusive, end time exclusive 221 local adj_op = op == "<" and "<" or ">="; -- Start time inclusive, end time exclusive
222 if minute == 0 then 222 if minute == 0 then