Software /
code /
prosody
Comparison
plugins/mod_saslauth.lua @ 4392:d2a7a44d68c5
mod_saslauth: Never send empty <mechanisms/>.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 13 Oct 2011 00:10:02 +0500 |
parent | 4361:605045b77bc6 |
child | 4395:d322c4553f97 |
comparison
equal
deleted
inserted
replaced
4391:71083327f608 | 4392:d2a7a44d68c5 |
---|---|
246 if not origin.username then | 246 if not origin.username then |
247 if secure_auth_only and not origin.secure then | 247 if secure_auth_only and not origin.secure then |
248 return; | 248 return; |
249 end | 249 end |
250 origin.sasl_handler = usermanager_get_sasl_handler(module.host); | 250 origin.sasl_handler = usermanager_get_sasl_handler(module.host); |
251 local mechanisms = origin.sasl_handler:mechanisms(); | |
252 if not next(mechanisms) then return; end | |
251 features:tag("mechanisms", mechanisms_attr); | 253 features:tag("mechanisms", mechanisms_attr); |
252 for mechanism in pairs(origin.sasl_handler:mechanisms()) do | 254 for mechanism in pairs(mechanisms) do |
253 if mechanism ~= "PLAIN" or origin.secure or allow_unencrypted_plain_auth then | 255 if mechanism ~= "PLAIN" or origin.secure or allow_unencrypted_plain_auth then |
254 features:tag("mechanism"):text(mechanism):up(); | 256 features:tag("mechanism"):text(mechanism):up(); |
255 end | 257 end |
256 end | 258 end |
257 features:up(); | 259 features:up(); |