plugins/mod_legacyauth.lua

changeset 438
193f9dd64f17
parent 421
63be85693710
child 519
cccd610a0ef9
equal deleted inserted replaced
437:c1a720db2157 438:193f9dd64f17
2 local st = require "util.stanza"; 2 local st = require "util.stanza";
3 local t_concat = table.concat; 3 local t_concat = table.concat;
4 4
5 require "core.discomanager".set("legacyauth", "jabber:iq:auth"); 5 require "core.discomanager".set("legacyauth", "jabber:iq:auth");
6 6
7 add_iq_handler("c2s_unauthed", "jabber:iq:auth", 7 module:add_iq_handler("c2s_unauthed", "jabber:iq:auth",
8 function (session, stanza) 8 function (session, stanza)
9 local username = stanza.tags[1]:child_with_name("username"); 9 local username = stanza.tags[1]:child_with_name("username");
10 local password = stanza.tags[1]:child_with_name("password"); 10 local password = stanza.tags[1]:child_with_name("password");
11 local resource = stanza.tags[1]:child_with_name("resource"); 11 local resource = stanza.tags[1]:child_with_name("resource");
12 if not (username and password and resource) then 12 if not (username and password and resource) then

mercurial