diff mod_host_guard/mod_host_guard.lua @ 831:0c3638673464

Merge upstream with my local LDAP work
author Rob Hoelz <rob@hoelz.ro>
date Tue, 18 Sep 2012 00:31:42 +0200
parents bf23a8966e20
children 21e99dc949ee
line wrap: on
line diff
--- a/mod_host_guard/mod_host_guard.lua	Tue Sep 18 00:29:28 2012 +0200
+++ b/mod_host_guard/mod_host_guard.lua	Tue Sep 18 00:31:42 2012 +0200
@@ -42,7 +42,7 @@
 
 local function handle_activation (host, u)
 	if guard_blockall:contains(host) or guard_protect:contains(host) then
-		if hosts[host] and hosts[host].events then
+		if hosts[host] and config.get(host, "core", "authentication") ~= "anonymous" then
 			hosts[host].events.add_handler("s2sin-established", s2s_hook, 500)
 			hosts[host].events.add_handler("route/remote", rr_hook, 500)
 			hosts[host].events.add_handler("stanza/jabber:server:dialback:result", s2s_hook, 500)
@@ -57,7 +57,7 @@
 
 local function handle_deactivation (host, u, i)
 	if guard_blockall:contains(host) or guard_protect:contains(host) then
-		if hosts[host] and hosts[host].events then
+		if hosts[host] and config.get(host, "core", "authentication") ~= "anonymous" then
 			hosts[host].events.remove_handler("s2sin-established", s2s_hook)
 			hosts[host].events.remove_handler("route/remote", rr_hook)
 			hosts[host].events.remove_handler("stanza/jabber:server:dialback:result", s2s_hook)