diff 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
parents 18b6a55dd5d6
children 19bb4606013f
line wrap: on
line diff
--- a/mod_firewall/conditions.lib.lua	Thu Feb 23 14:05:39 2017 +0000
+++ b/mod_firewall/conditions.lib.lua	Thu Feb 23 14:06:48 2017 +0000
@@ -162,6 +162,14 @@
 	return ("is_admin(bare_to, %s)"):format(host ~= "*" and host or nil), { "is_admin", "bare_to" };
 end
 
+function condition_handlers.FROM_ADMIN()
+	return ("is_admin(bare_from, from_host)"):format(host ~= "*" and host or nil), { "is_admin", "bare_from", "split_from" };
+end
+
+function condition_handlers.TO_ADMIN()
+	return ("is_admin(bare_to, to_host)"):format(host ~= "*" and host or nil), { "is_admin", "bare_to", "split_to" };
+end
+
 local day_numbers = { sun = 0, mon = 2, tue = 3, wed = 4, thu = 5, fri = 6, sat = 7 };
 
 local function current_time_check(op, hour, minute)