diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-04-29 02:08:12 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-04-29 02:08:12 +0100 |
commit | e241b85a56b96bbda1719448a08e68cf5b8eed56 (patch) | |
tree | 5564cfe35e899b0932ba57718ae84eccf417c7c8 /plugins/mod_saslauth.lua | |
parent | 3ba4121e11d4696a40e59486db4f005bf2c7eccd (diff) | |
download | prosody-e241b85a56b96bbda1719448a08e68cf5b8eed56.tar.gz prosody-e241b85a56b96bbda1719448a08e68cf5b8eed56.zip |
mod_*: Fix many unnecessary global accesses in modules (already committed to main repo)
Diffstat (limited to 'plugins/mod_saslauth.lua')
-rw-r--r-- | plugins/mod_saslauth.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 31d62325..f7b30aab 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -10,8 +10,10 @@ local st = require "util.stanza"; local sm_bind_resource = require "core.sessionmanager".bind_resource; +local sm_make_authenticated = require "core.sessionmanager".make_authenticated; local base64 = require "util.encodings".base64; +local datamanager_load = require "util.datamanager".load; local usermanager_validate_credentials = require "core.usermanager".validate_credentials; local t_concat, t_insert = table.concat, table.insert; local tostring = tostring; @@ -49,14 +51,14 @@ local function handle_status(session, status) session.sasl_handler = nil; elseif status == "success" then if not session.sasl_handler.username then error("SASL succeeded but we didn't get a username!"); end -- TODO move this to sessionmanager - sessionmanager.make_authenticated(session, session.sasl_handler.username); + sm_make_authenticated(session, session.sasl_handler.username); session.sasl_handler = nil; session:reset_stream(); end end local function password_callback(node, host, mechanism, decoder) - local password = (datamanager.load(node, host, "accounts") or {}).password; -- FIXME handle hashed passwords + local password = (datamanager_load(node, host, "accounts") or {}).password; -- FIXME handle hashed passwords local func = function(x) return x; end; if password then if mechanism == "PLAIN" then |