aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_saslauth.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-01-11 19:05:08 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-01-11 19:05:08 +0500
commit2a388bda5c6408389d0cbd64522fb5924133a8fc (patch)
treee0440eabe672a239049d29dcdccd2ef18515c846 /plugins/mod_saslauth.lua
parent9dd8d35ae800ee5e9977a34dc14d5cae22d3bccb (diff)
downloadprosody-2a388bda5c6408389d0cbd64522fb5924133a8fc.tar.gz
prosody-2a388bda5c6408389d0cbd64522fb5924133a8fc.zip
mod_saslauth: Made some variables local to avoid unnecessary global access.
Diffstat (limited to 'plugins/mod_saslauth.lua')
-rw-r--r--plugins/mod_saslauth.lua32
1 files changed, 16 insertions, 16 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index 2175a7c5..d3bf24af 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -36,7 +36,7 @@ local xmlns_stanzas ='urn:ietf:params:xml:ns:xmpp-stanzas';
local new_sasl
if sasl_backend == "cyrus" then
- cyrus_new = require "util.sasl_cyrus".new;
+ local cyrus_new = require "util.sasl_cyrus".new;
new_sasl = function(realm)
return cyrus_new(realm, module:get_option("cyrus_service_name") or "xmpp")
end
@@ -45,26 +45,26 @@ else
new_sasl = require "util.sasl".new;
end
-default_authentication_profile = {
+local default_authentication_profile = {
plain = function(username, realm)
- local prepped_username = nodeprep(username);
- if not prepped_username then
- log("debug", "NODEprep failed on username: %s", username);
- return "", nil;
- end
- local password = usermanager_get_password(prepped_username, realm);
- if not password then
- return "", nil;
- end
- return password, true;
+ local prepped_username = nodeprep(username);
+ if not prepped_username then
+ log("debug", "NODEprep failed on username: %s", username);
+ return "", nil;
end
+ local password = usermanager_get_password(prepped_username, realm);
+ if not password then
+ return "", nil;
+ end
+ return password, true;
+ end
};
-anonymous_authentication_profile = {
+local anonymous_authentication_profile = {
anonymous = function(username, realm)
- return true; -- for normal usage you should always return true here
- end
-}
+ return true; -- for normal usage you should always return true here
+ end
+};
local function build_reply(status, ret, err_msg)
local reply = st.stanza(status, {xmlns = xmlns_sasl});