comparison mod_firewall/conditions.lib.lua @ 2119:5f6c18fd0161

mod_firewall: Correct zone condition to check bare JID
author Kim Alvefur <zash@zash.se>
date Thu, 17 Mar 2016 14:45:08 +0100
parents 2bb42ba342f3
children edf5cf3c474b
comparison
equal deleted inserted replaced
2118:643b254e75de 2119:5f6c18fd0161
71 end 71 end
72 72
73 local function zone_check(zone, which) 73 local function zone_check(zone, which)
74 local which_not = which == "from" and "to" or "from"; 74 local which_not = which == "from" and "to" or "from";
75 return ("(zone_%s[%s_host] or zone_%s[%s] or zone_%s[bare_%s]) " 75 return ("(zone_%s[%s_host] or zone_%s[%s] or zone_%s[bare_%s]) "
76 .."and not(zone_%s[%s_host] or zone_%s[%s] or zone_%s[%s])" 76 .."and not(zone_%s[%s_host] or zone_%s[%s] or zone_%s[bare_%s])"
77 ) 77 )
78 :format(zone, which, zone, which, zone, which, 78 :format(zone, which, zone, which, zone, which,
79 zone, which_not, zone, which_not, zone, which_not), { 79 zone, which_not, zone, which_not, zone, which_not), {
80 "split_to", "split_from", "bare_to", "bare_from", "zone:"..zone 80 "split_to", "split_from", "bare_to", "bare_from", "zone:"..zone
81 }; 81 };