Comparison

plugins/mod_dialback.lua @ 4238:05f991b4a90e

Merge 0.8->trunk
author Matthew Wild <mwild1@gmail.com>
date Tue, 05 Apr 2011 13:26:43 +0100
parent 3651:337391d34b70
parent 4227:6b83ef6ec845
child 4264:fa36e749749c
comparison
equal deleted inserted replaced
4226:decfa487e1e8 4238:05f991b4a90e
10 local hosts = _G.hosts; 10 local hosts = _G.hosts;
11 local send_s2s = require "core.s2smanager".send_to_host; 11 local send_s2s = require "core.s2smanager".send_to_host;
12 local s2s_make_authenticated = require "core.s2smanager".make_authenticated; 12 local s2s_make_authenticated = require "core.s2smanager".make_authenticated;
13 local s2s_initiate_dialback = require "core.s2smanager".initiate_dialback; 13 local s2s_initiate_dialback = require "core.s2smanager".initiate_dialback;
14 local s2s_verify_dialback = require "core.s2smanager".verify_dialback; 14 local s2s_verify_dialback = require "core.s2smanager".verify_dialback;
15 local s2s_destroy_session = require "core.s2smanager".destroy_session;
16 15
17 local log = module._log; 16 local log = module._log;
18 17
19 local st = require "util.stanza"; 18 local st = require "util.stanza";
20 19
124 return true; 123 return true;
125 end 124 end
126 if stanza.attr.type == "valid" then 125 if stanza.attr.type == "valid" then
127 s2s_make_authenticated(origin, attr.from); 126 s2s_make_authenticated(origin, attr.from);
128 else 127 else
129 s2s_destroy_session(origin) 128 origin:close("not-authorized", "dialback authentication failed");
130 end 129 end
131 return true; 130 return true;
132 end 131 end
133 end); 132 end);
134 133