Comparison

mod_firewall/conditions.lib.lua @ 2553:7ed2a66bfabd

mod_firewall: Add TO/FROM ADMIN
author Matthew Wild <mwild1@gmail.com>
date Thu, 23 Feb 2017 14:06:48 +0000
parent 2552:18b6a55dd5d6
child 2554:19bb4606013f
comparison
equal deleted inserted replaced
2552:18b6a55dd5d6 2553:7ed2a66bfabd
158 return ("is_admin(bare_from, %s)"):format(host ~= "*" and host or nil), { "is_admin", "bare_from" }; 158 return ("is_admin(bare_from, %s)"):format(host ~= "*" and host or nil), { "is_admin", "bare_from" };
159 end 159 end
160 160
161 function condition_handlers.TO_ADMIN_OF(host) 161 function condition_handlers.TO_ADMIN_OF(host)
162 return ("is_admin(bare_to, %s)"):format(host ~= "*" and host or nil), { "is_admin", "bare_to" }; 162 return ("is_admin(bare_to, %s)"):format(host ~= "*" and host or nil), { "is_admin", "bare_to" };
163 end
164
165 function condition_handlers.FROM_ADMIN()
166 return ("is_admin(bare_from, from_host)"):format(host ~= "*" and host or nil), { "is_admin", "bare_from", "split_from" };
167 end
168
169 function condition_handlers.TO_ADMIN()
170 return ("is_admin(bare_to, to_host)"):format(host ~= "*" and host or nil), { "is_admin", "bare_to", "split_to" };
163 end 171 end
164 172
165 local day_numbers = { sun = 0, mon = 2, tue = 3, wed = 4, thu = 5, fri = 6, sat = 7 }; 173 local day_numbers = { sun = 0, mon = 2, tue = 3, wed = 4, thu = 5, fri = 6, sat = 7 };
166 174
167 local function current_time_check(op, hour, minute) 175 local function current_time_check(op, hour, minute)