Comparison

plugins/mod_saslauth.lua @ 6489:1f07c72112d2

mod_saslauth: Log warning if no SASL mechanisms were offered
author Kim Alvefur <zash@zash.se>
date Tue, 21 Oct 2014 12:57:56 +0200
parent 6488:c91193b7e72c
child 6490:8ad74f48b2aa
comparison
equal deleted inserted replaced
6488:c91193b7e72c 6489:1f07c72112d2
233 for mechanism in pairs(origin.sasl_handler:mechanisms()) do 233 for mechanism in pairs(origin.sasl_handler:mechanisms()) do
234 if mechanism ~= "PLAIN" or origin.secure or allow_unencrypted_plain_auth then 234 if mechanism ~= "PLAIN" or origin.secure or allow_unencrypted_plain_auth then
235 mechanisms:tag("mechanism"):text(mechanism):up(); 235 mechanisms:tag("mechanism"):text(mechanism):up();
236 end 236 end
237 end 237 end
238 if mechanisms[1] then features:add_child(mechanisms); end 238 if mechanisms[1] then
239 features:add_child(mechanisms);
240 else
241 (origin.log or log)("warn", "No SASL mechanisms to offer");
242 end
239 else 243 else
240 features:tag("bind", bind_attr):tag("required"):up():up(); 244 features:tag("bind", bind_attr):tag("required"):up():up();
241 features:tag("session", xmpp_session_attr):tag("optional"):up():up(); 245 features:tag("session", xmpp_session_attr):tag("optional"):up():up();
242 end 246 end
243 end); 247 end);