aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_saslauth.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-07-17 18:58:25 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-07-17 18:58:25 +0500
commit616d8ecbb01b257e612fb5781b2b92d08c840301 (patch)
treee5d767d6b86fc6d0b0478f8bdd5293be09652f82 /plugins/mod_saslauth.lua
parentbab68f4fb27eceb876d525f068933fbfa995ff98 (diff)
downloadprosody-616d8ecbb01b257e612fb5781b2b92d08c840301.tar.gz
prosody-616d8ecbb01b257e612fb5781b2b92d08c840301.zip
mod_saslauth: A little cleanup for anonymous_login.
Diffstat (limited to 'plugins/mod_saslauth.lua')
-rw-r--r--plugins/mod_saslauth.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index 47c0fbb3..cbf9eeb7 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -28,6 +28,7 @@ local config = require "core.configmanager";
local secure_auth_only = module:get_option("c2s_require_encryption") or module:get_option("require_encryption");
local sasl_backend = module:get_option("sasl_backend") or "builtin";
+local anonymous_login = module:get_option("anonymous_login");
-- Cyrus config options
local require_provisioning = module:get_option("cyrus_require_provisioning") or false;
@@ -118,7 +119,7 @@ end
local function sasl_handler(session, stanza)
if stanza.name == "auth" then
-- FIXME ignoring duplicates because ejabberd does
- if config.get(session.host or "*", "core", "anonymous_login") then
+ if anonymous_login then
if stanza.attr.mechanism ~= "ANONYMOUS" then
return session.send(build_reply("failure", "invalid-mechanism"));
end
@@ -166,7 +167,7 @@ module:hook("stream-features", function(event)
return;
end
local realm = module:get_option("sasl_realm") or origin.host;
- if module:get_option("anonymous_login") then
+ if anonymous_login then
origin.sasl_handler = new_sasl(realm, anonymous_authentication_profile);
else
origin.sasl_handler = usermanager_get_sasl_handler(module.host);