mod_firewall/conditions.lib.lua
changeset 2541 acdc1767a715
parent 2538 13b8c31dce01
child 2549 9b46d24edf0d
equal deleted inserted replaced
2540:22a271641c29 2541:acdc1767a715
    98 
    98 
    99 function condition_handlers.LEAVING(zone)
    99 function condition_handlers.LEAVING(zone)
   100 	return zone_check(zone, "from");
   100 	return zone_check(zone, "from");
   101 end
   101 end
   102 
   102 
       
   103 -- IN ROSTER? (parameter is deprecated)
   103 function condition_handlers.IN_ROSTER(yes_no)
   104 function condition_handlers.IN_ROSTER(yes_no)
   104 	local in_roster_requirement = string_to_boolean(yes_no);
   105 	local in_roster_requirement = string_to_boolean(yes_no or "yes"); -- COMPAT w/ older scripts
   105 	return "not "..(in_roster_requirement and "not" or "").." roster_entry", { "roster_entry" };
   106 	return "not "..(in_roster_requirement and "not" or "").." roster_entry", { "roster_entry" };
   106 end
   107 end
   107 
   108 
   108 function condition_handlers.IN_ROSTER_GROUP(group)
   109 function condition_handlers.IN_ROSTER_GROUP(group)
   109 	return ("not not (roster_entry and roster_entry.groups[%q])"):format(group), { "roster_entry" };
   110 	return ("not not (roster_entry and roster_entry.groups[%q])"):format(group), { "roster_entry" };