diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-11-15 22:29:24 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-11-15 22:29:24 +0000 |
commit | 60292ade15292d2398d91a1af6a578d6a20c9f34 (patch) | |
tree | 73a5d330473223ad3e0bfb100a2271afacee4855 /plugins/mod_legacyauth.lua | |
parent | 7fb57614491db05660e8952634aeac67d4ff22f5 (diff) | |
parent | 49ab3af4421a0410a723fa8dc7286d4adf736fc9 (diff) | |
download | prosody-60292ade15292d2398d91a1af6a578d6a20c9f34.tar.gz prosody-60292ade15292d2398d91a1af6a578d6a20c9f34.zip |
Merge from waqas
Diffstat (limited to 'plugins/mod_legacyauth.lua')
-rw-r--r-- | plugins/mod_legacyauth.lua | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/plugins/mod_legacyauth.lua b/plugins/mod_legacyauth.lua index ed698bf2..07e82549 100644 --- a/plugins/mod_legacyauth.lua +++ b/plugins/mod_legacyauth.lua @@ -23,22 +23,10 @@ add_iq_handler("c2s_unauthed", "jabber:iq:auth", -- Authentication successful! local success, err = sessionmanager.make_authenticated(session, username); if success then - success, err = sessionmanager.bind_resource(session, resource); - --FIXME: Reply with error + local err_type, err_msg; + success, err_type, err, err_msg = sessionmanager.bind_resource(session, resource); if not success then - local reply = st.reply(stanza); - reply.attr.type = "error"; - if err == "conflict" then - reply:tag("error", { code = "409", type = "cancel" }) - :tag("conflict", { xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas" }); - elseif err == "constraint" then - reply:tag("error", { code = "409", type = "cancel" }) - :tag("already-bound", { xmlns = "x-lxmppd:extensions:legacyauth" }); - elseif err == "auth" then - reply:tag("error", { code = "401", type = "auth" }) - :tag("not-authorized", { xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas" }); - end - send(session, reply); + session.send(st.error_reply(stanza, err_type, err, err_msg)); return true; end end |