Comparison

mod_auth_external/mod_auth_external.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
parent 305:4c3abf1a9b5a
child 814:881ec9919144
comparison
equal deleted inserted replaced
341:f801ce6826d5 342:8e9e5c7d97ff
109 end 109 end
110 110
111 function provider.create_user(username, password) return nil, "Account creation/modification not available."; end 111 function provider.create_user(username, password) return nil, "Account creation/modification not available."; end
112 112
113 function provider.get_sasl_handler() 113 function provider.get_sasl_handler()
114 local realm = module:get_option("sasl_realm") or module.host;
115 local testpass_authentication_profile = { 114 local testpass_authentication_profile = {
116 plain_test = function(sasl, username, password, realm) 115 plain_test = function(sasl, username, password, realm)
117 local prepped_username = nodeprep(username); 116 local prepped_username = nodeprep(username);
118 if not prepped_username then 117 if not prepped_username then
119 log("debug", "NODEprep failed on username: %s", username); 118 log("debug", "NODEprep failed on username: %s", username);
120 return "", nil; 119 return "", nil;
121 end 120 end
122 return usermanager.test_password(prepped_username, realm, password), true; 121 return usermanager.test_password(prepped_username, realm, password), true;
123 end, 122 end,
124 }; 123 };
125 return new_sasl(realm, testpass_authentication_profile); 124 return new_sasl(module.host, testpass_authentication_profile);
126 end 125 end
127 126
128 function provider.is_admin(jid) 127 function provider.is_admin(jid)
129 local admins = config.get(host, "core", "admins"); 128 local admins = config.get(host, "core", "admins");
130 if admins ~= config.get("*", "core", "admins") then 129 if admins ~= config.get("*", "core", "admins") then