Mercurial > prosody-hg
comparison plugins/mod_auth_cyrus.lua @ 4159:52eaa2590bfb
mod_auth_cyrus: Print some diagnostic log messages about the available mechanisms.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Wed, 23 Feb 2011 01:22:04 +0500 |
| parents | d50e2c937717 |
| children | f08f649b898b |
comparison
equal
deleted
inserted
replaced
| 4158:14581c3f33bd | 4159:52eaa2590bfb |
|---|---|
| 23 return cyrus_new( | 23 return cyrus_new( |
| 24 cyrus_service_realm or realm, | 24 cyrus_service_realm or realm, |
| 25 cyrus_service_name or "xmpp", | 25 cyrus_service_name or "xmpp", |
| 26 cyrus_application_name or "prosody" | 26 cyrus_application_name or "prosody" |
| 27 ); | 27 ); |
| 28 end | |
| 29 | |
| 30 do -- diagnostic | |
| 31 local realm = module:get_option("sasl_realm") or module.host; | |
| 32 local list; | |
| 33 for mechanism in pairs(new_sasl(realm):mechanisms()) do | |
| 34 list = (not(list) and mechanism) or (list..", "..mechanism); | |
| 35 end | |
| 36 if not list then | |
| 37 module:log("error", "No Cyrus SASL mechanisms available"); | |
| 38 else | |
| 39 module:log("debug", "Available Cyrus SASL mechanisms: %s", list); | |
| 40 end | |
| 28 end | 41 end |
| 29 | 42 |
| 30 function new_default_provider(host) | 43 function new_default_provider(host) |
| 31 local provider = { name = "cyrus" }; | 44 local provider = { name = "cyrus" }; |
| 32 log("debug", "initializing default authentication provider for host '%s'", host); | 45 log("debug", "initializing default authentication provider for host '%s'", host); |
