mod_storage_sql: Add method for listing stores
[prosody.git] / plugins / mod_proxy65.lua
index 896780fbe081ca2db875db994e3a90acfb866101..d6e41604555e05d240c268e49b97ab88fbcbe33a 100644 (file)
@@ -14,6 +14,7 @@ local st = require "util.stanza";
 local sha1 = require "util.hashes".sha1;
 local b64 = require "util.encodings".base64.encode;
 local server = require "net.server";
+local portmanager = require "core.portmanager";
 
 local sessions, transfers = module:shared("sessions", "transfers");
 local max_buffer_size = 4096;
@@ -123,9 +124,11 @@ function module.add_host(module)
                -- check ACL
                while proxy_acl and #proxy_acl > 0 do -- using 'while' instead of 'if' so we can break out of it
                        local jid = stanza.attr.from;
+                       local allow;
                        for _, acl in ipairs(proxy_acl) do
-                               if jid_compare(jid, acl) then break; end
+                               if jid_compare(jid, acl) then allow = true; break; end
                        end
+                       if allow then break; end
                        module:log("warn", "Denying use of proxy for %s", tostring(stanza.attr.from));
                        origin.send(st.error_reply(stanza, "auth", "forbidden"));
                        return true;