Comparison

plugins/mod_saslauth.lua @ 1638:6fd0c2f46b21

mod_saslauth: Fix indentation
author Matthew Wild <mwild1@gmail.com>
date Wed, 05 Aug 2009 16:35:13 +0100
parent 1637:c1292624f991
child 1639:0914d128c55e
comparison
equal deleted inserted replaced
1637:c1292624f991 1638:6fd0c2f46b21
66 session:reset_stream(); 66 session:reset_stream();
67 end 67 end
68 end 68 end
69 69
70 local function credentials_callback(mechanism, ...) 70 local function credentials_callback(mechanism, ...)
71 if mechanism == "PLAIN" then 71 if mechanism == "PLAIN" then
72 local username, hostname, password = arg[1], arg[2], arg[3]; 72 local username, hostname, password = arg[1], arg[2], arg[3];
73 local response = usermanager_validate_credentials(hostname, username, password, mechanism) 73 local response = usermanager_validate_credentials(hostname, username, password, mechanism)
74 if response == nil then return false 74 if response == nil then return false
75 else return response end 75 else return response end
76 elseif mechanism == "DIGEST-MD5" then 76 elseif mechanism == "DIGEST-MD5" then
77 function func(x) return x; end 77 function func(x) return x; end
78 local node, domain, realm, decoder = arg[1], arg[2], arg[3], arg[4]; 78 local node, domain, realm, decoder = arg[1], arg[2], arg[3], arg[4];
79 local password = usermanager_get_password(node, domain) 79 local password = usermanager_get_password(node, domain)
80 if password then 80 if password then
81 if decoder then node, realm, password = decoder(node), decoder(realm), decoder(password); end 81 if decoder then node, realm, password = decoder(node), decoder(realm), decoder(password); end
82 return func, md5(node..":"..realm..":"..password); 82 return func, md5(node..":"..realm..":"..password);
83 else 83 else
84 return func, nil; 84 return func, nil;
85 end 85 end
86 end 86 end
87 end 87 end
88 88
89 local function sasl_handler(session, stanza) 89 local function sasl_handler(session, stanza)
90 if stanza.name == "auth" then 90 if stanza.name == "auth" then
91 -- FIXME ignoring duplicates because ejabberd does 91 -- FIXME ignoring duplicates because ejabberd does