comparison mod_firewall/conditions.lib.lua @ 2575:214b49d05ea1

mod_firewall: Fix TO/FROM ADMIN to use current (module) host
author Matthew Wild <mwild1@gmail.com>
date Sat, 25 Feb 2017 15:47:22 +0000
parents 240985f7d1f7
children 00cef058df8d
comparison
equal deleted inserted replaced
2574:f65c5927ee8e 2575:214b49d05ea1
162 function condition_handlers.TO_ADMIN_OF(host) 162 function condition_handlers.TO_ADMIN_OF(host)
163 return ("is_admin(bare_to, %s)"):format(host ~= "*" and host or nil), { "is_admin", "bare_to" }; 163 return ("is_admin(bare_to, %s)"):format(host ~= "*" and host or nil), { "is_admin", "bare_to" };
164 end 164 end
165 165
166 function condition_handlers.FROM_ADMIN() 166 function condition_handlers.FROM_ADMIN()
167 return ("is_admin(bare_from, from_host)"):format(host ~= "*" and host or nil), { "is_admin", "bare_from", "split_from" }; 167 return ("is_admin(bare_from, current_host)"), { "is_admin", "bare_from", "current_host" };
168 end 168 end
169 169
170 function condition_handlers.TO_ADMIN() 170 function condition_handlers.TO_ADMIN()
171 return ("is_admin(bare_to, to_host)"):format(host ~= "*" and host or nil), { "is_admin", "bare_to", "split_to" }; 171 return ("is_admin(bare_to, current_host)"), { "is_admin", "bare_to", "current_host" };
172 end 172 end
173 173
174 local day_numbers = { sun = 0, mon = 2, tue = 3, wed = 4, thu = 5, fri = 6, sat = 7 }; 174 local day_numbers = { sun = 0, mon = 2, tue = 3, wed = 4, thu = 5, fri = 6, sat = 7 };
175 175
176 local function current_time_check(op, hour, minute) 176 local function current_time_check(op, hour, minute)