mod_invite/mod_invite.lua
changeset 3556 5370bc374c83
parent 3553 b059a3fb2a58
child 3557 5b15ce870a5b
equal deleted inserted replaced
3555:7fc6a63c3bd0 3556:5370bc374c83
    32 				return k
    32 				return k
    33 			end
    33 			end
    34 		end)
    34 		end)
    35 end
    35 end
    36 
    36 
    37 function generate_page(event)
    37 function generate_page(event, token)
    38 	local request, response = event.request, event.response;
    38 	local request, response = event.request, event.response;
    39 
    39 
    40 	local tokens = invite_storage:get() or {};
    40 	local tokens = invite_storage:get() or {};
    41 
       
    42 	local token = request.path:match("^/invite/([^/]*)$");
       
    43 
    41 
    44 	response.headers.content_type = "text/html; charset=utf-8";
    42 	response.headers.content_type = "text/html; charset=utf-8";
    45 
    43 
    46 	if not token or not tokens[token] then
    44 	if not token or not tokens[token] then
    47 		local template = assert(module:load_resource("invite/invite_result.html")):read("*a");
    45 		local template = assert(module:load_resource("invite/invite_result.html")):read("*a");