comparison plugins/mod_auth_cyrus.lua @ 4191:dfeae208e5b4

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
parents 6f509033f855
children 58c9519dc461
comparison
equal deleted inserted replaced
4190:6f509033f855 4191:dfeae208e5b4
26 cyrus_application_name or "prosody" 26 cyrus_application_name or "prosody"
27 ); 27 );
28 end 28 end
29 29
30 do -- diagnostic 30 do -- diagnostic
31 local realm = module:get_option("sasl_realm") or module.host;
32 local list; 31 local list;
33 for mechanism in pairs(new_sasl(realm):mechanisms()) do 32 for mechanism in pairs(new_sasl(module.host):mechanisms()) do
34 list = (not(list) and mechanism) or (list..", "..mechanism); 33 list = (not(list) and mechanism) or (list..", "..mechanism);
35 end 34 end
36 if not list then 35 if not list then
37 module:log("error", "No Cyrus SASL mechanisms available"); 36 module:log("error", "No Cyrus SASL mechanisms available");
38 else 37 else
66 function provider.create_user(username, password) 65 function provider.create_user(username, password)
67 return nil, "Account creation/modification not available with Cyrus SASL."; 66 return nil, "Account creation/modification not available with Cyrus SASL.";
68 end 67 end
69 68
70 function provider.get_sasl_handler() 69 function provider.get_sasl_handler()
71 local realm = module:get_option("sasl_realm") or module.host; 70 local handler = new_sasl(module.host);
72 local handler = new_sasl(realm);
73 if require_provisioning then 71 if require_provisioning then
74 function handler.require_provisioning(username) 72 function handler.require_provisioning(username)
75 return usermanager_user_exists(username, module.host); 73 return usermanager_user_exists(username, module.host);
76 end 74 end
77 end 75 end