diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-08-05 16:37:28 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-08-05 16:37:28 +0100 |
commit | 4de34d6a8c4adbea78f40f9f488e63a70e9fc151 (patch) | |
tree | 044bc58617fa832ffe6486fe5c346467ebf839b1 /plugins/mod_saslauth.lua | |
parent | d6efe651217605deb31fa9f39a5624d285a8e000 (diff) | |
download | prosody-4de34d6a8c4adbea78f40f9f488e63a70e9fc151.tar.gz prosody-4de34d6a8c4adbea78f40f9f488e63a70e9fc151.zip |
mod_saslauth: Fix coding style and layout, and use of arg[] for vararg
Diffstat (limited to 'plugins/mod_saslauth.lua')
-rw-r--r-- | plugins/mod_saslauth.lua | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 48593031..8d3b4ae4 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -69,16 +69,21 @@ end local function credentials_callback(mechanism, ...) if mechanism == "PLAIN" then - local username, hostname, password = arg[1], arg[2], arg[3]; - local response = usermanager_validate_credentials(hostname, username, password, mechanism) - if response == nil then return false - else return response end + local username, hostname, password = ...; + local response = usermanager_validate_credentials(hostname, username, password, mechanism); + if response == nil then + return false; + else + return response; + end elseif mechanism == "DIGEST-MD5" then function func(x) return x; end - local node, domain, realm, decoder = arg[1], arg[2], arg[3], arg[4]; - local password = usermanager_get_password(node, domain) + local node, domain, realm, decoder = ...; + local password = usermanager_get_password(node, domain); if password then - if decoder then node, realm, password = decoder(node), decoder(realm), decoder(password); end + if decoder then + node, realm, password = decoder(node), decoder(realm), decoder(password); + end return func, md5(node..":"..realm..":"..password); else return func, nil; |