Comparison

mod_register_web/mod_register_web.lua @ 2740:57d4680b86a4

mod_register_web: Normalize indentation [luacheck]
author Kim Alvefur <zash@zash.se>
date Thu, 17 Aug 2017 14:49:52 +0200
parent 2739:7d864a03b509
child 2922:9f60905406ba
comparison
equal deleted inserted replaced
2739:7d864a03b509 2740:57d4680b86a4
38 if next(captcha_options) ~= nil then 38 if next(captcha_options) ~= nil then
39 local recaptcha_tpl = get_template "recaptcha"; 39 local recaptcha_tpl = get_template "recaptcha";
40 40
41 function generate_captcha(display_options) 41 function generate_captcha(display_options)
42 return recaptcha_tpl.apply(setmetatable({ 42 return recaptcha_tpl.apply(setmetatable({
43 recaptcha_display_error = display_options and display_options.recaptcha_error 43 recaptcha_display_error = display_options and display_options.recaptcha_error
44 and ("&error="..display_options.recaptcha_error) or ""; 44 and ("&error="..display_options.recaptcha_error) or "";
45 }, { 45 }, {
46 __index = function (t, k) 46 __index = function (t, k)
47 if captcha_options[k] then return captcha_options[k]; end 47 if captcha_options[k] then return captcha_options[k]; end
48 module:log("error", "Missing parameter from captcha_options: %s", k); 48 module:log("error", "Missing parameter from captcha_options: %s", k);
49 end 49 end
50 })); 50 }));
51 end 51 end
52 function verify_captcha(request, form, callback) 52 function verify_captcha(request, form, callback)
53 http.request("https://www.google.com/recaptcha/api/siteverify", { 53 http.request("https://www.google.com/recaptcha/api/siteverify", {