Software /
code /
prosody
Comparison
plugins/mod_auth_internal_plain.lua @ 4160:f08f649b898b
mod_auth_*: Get rid of undocumented and broken 'sasl_realm' config option.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Wed, 23 Feb 2011 01:34:46 +0500 |
parent | 3994:42899d5efe3b |
child | 4603:6900c9484834 |
comparison
equal
deleted
inserted
replaced
4159:52eaa2590bfb | 4160:f08f649b898b |
---|---|
66 function provider.delete_user(username) | 66 function provider.delete_user(username) |
67 return datamanager.store(username, host, "accounts", nil); | 67 return datamanager.store(username, host, "accounts", nil); |
68 end | 68 end |
69 | 69 |
70 function provider.get_sasl_handler() | 70 function provider.get_sasl_handler() |
71 local realm = module:get_option("sasl_realm") or module.host; | |
72 local getpass_authentication_profile = { | 71 local getpass_authentication_profile = { |
73 plain = function(sasl, username, realm) | 72 plain = function(sasl, username, realm) |
74 local prepped_username = nodeprep(username); | 73 local prepped_username = nodeprep(username); |
75 if not prepped_username then | 74 if not prepped_username then |
76 log("debug", "NODEprep failed on username: %s", username); | 75 log("debug", "NODEprep failed on username: %s", username); |
81 return "", nil; | 80 return "", nil; |
82 end | 81 end |
83 return password, true; | 82 return password, true; |
84 end | 83 end |
85 }; | 84 }; |
86 return new_sasl(realm, getpass_authentication_profile); | 85 return new_sasl(module.host, getpass_authentication_profile); |
87 end | 86 end |
88 | 87 |
89 return provider; | 88 return provider; |
90 end | 89 end |
91 | 90 |