Mercurial > prosody-modules
comparison mod_auth_dovecot/mod_auth_dovecot.lua @ 342:8e9e5c7d97ff
mod_auth_*: Get rid of undocumented and broken 'sasl_realm' config option.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Wed, 23 Feb 2011 01:36:46 +0500 |
| parents | 5d306466f3f6 |
| children | abac17cb5032 |
comparison
equal
deleted
inserted
replaced
| 341:f801ce6826d5 | 342:8e9e5c7d97ff |
|---|---|
| 206 function provider.create_user(username, password) | 206 function provider.create_user(username, password) |
| 207 return nil, "Cannot create_user in dovecot backend."; | 207 return nil, "Cannot create_user in dovecot backend."; |
| 208 end | 208 end |
| 209 | 209 |
| 210 function provider.get_sasl_handler() | 210 function provider.get_sasl_handler() |
| 211 local realm = module:get_option("sasl_realm") or module.host; | |
| 212 local getpass_authentication_profile = { | 211 local getpass_authentication_profile = { |
| 213 plain_test = function(sasl, username, password, realm) | 212 plain_test = function(sasl, username, password, realm) |
| 214 local prepped_username = nodeprep(username); | 213 local prepped_username = nodeprep(username); |
| 215 if not prepped_username then | 214 if not prepped_username then |
| 216 log("debug", "NODEprep failed on username: %s", username); | 215 log("debug", "NODEprep failed on username: %s", username); |
| 217 return "", nil; | 216 return "", nil; |
| 218 end | 217 end |
| 219 return usermanager.test_password(prepped_username, realm, password), true; | 218 return usermanager.test_password(prepped_username, realm, password), true; |
| 220 end | 219 end |
| 221 }; | 220 }; |
| 222 return new_sasl(realm, getpass_authentication_profile); | 221 return new_sasl(module.host, getpass_authentication_profile); |
| 223 end | 222 end |
| 224 | 223 |
| 225 return provider; | 224 return provider; |
| 226 end | 225 end |
| 227 | 226 |
