liquid_feedback_frontend

view app/main/member_image/show.lua @ 1145:904f6807f7fa

Added support for upcoming moonbridge bases WebMCP
author bsw
date Sat Mar 21 15:26:39 2015 +0100 (2015-03-21)
parents f52f918b38b8
children 24787d0d9317
line source
1 local image_type = param.get("image_type")
2 local record = MemberImage:by_pk(param.get_id(), image_type, true)
4 if record == nil then
5 local default_file = ({ avatar = "avatar.jpg", photo = nil })[image_type] or 'icons/16/lightning.png'
6 request.redirect{ static = default_file }
7 return
8 end
10 assert(record.content_type, "No content-type set for image.")
12 slot.set_layout(nil, record.content_type)
14 if record then
15 request.add_header("Cache-Control", "max-age=300"); -- let the client cache the image for 5 minutes
16 slot.put_into("data", record.data)
17 end

Impressum / About Us