Comparison

mod_auth_phpbb3/mod_auth_phpbb3.lua @ 814:881ec9919144

mod_auth_*: Use module:provides(), and don't explicitly specify provider.name.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 13 Sep 2012 00:08:29 +0500
parent 665:684cc57a49c1
child 1343:7dbde05b48a9
comparison
equal deleted inserted replaced
813:2469f779b3f7 814:881ec9919144
185 if #hash == 34 then return hash; end 185 if #hash == 34 then return hash; end
186 return md5(password, true); 186 return md5(password, true);
187 end 187 end
188 188
189 189
190 provider = { name = "phpbb3" }; 190 provider = {};
191 191
192 function provider.test_password(username, password) 192 function provider.test_password(username, password)
193 local hash = get_password(username); 193 local hash = get_password(username);
194 return hash and phpbbCheckHash(password, hash); 194 return hash and phpbbCheckHash(password, hash);
195 end 195 end
267 return "failure", "not-authorized", "Unable to authorize you with the authentication credentials you've sent."; 267 return "failure", "not-authorized", "Unable to authorize you with the authentication credentials you've sent.";
268 end 268 end
269 return sasl; 269 return sasl;
270 end 270 end
271 271
272 module:add_item("auth-provider", provider); 272 module:provides("auth", provider);
273 273