liquid_feedback_frontend
view app/main/oauth2/session.lua @ 1818:2d4136357989
Final version of survey
| author | bsw | 
|---|---|
| date | Tue Jan 04 14:31:01 2022 +0100 (2022-01-04) | 
| parents | 25ea15b4bd5e | 
| children | 
 line source
     1 if not request.is_post() then
     2   return execute.view { module = "index", view = "405" }
     3 end
     5 slot.set_layout(nil, "application/json")
     7 local r = json.object{
     8   member_id = json.null
     9 }
    11 if app.session and app.session.member_id then
    12   local origin = request.get_header("Origin")
    13   if origin then
    14     local system_applications = SystemApplication:by_origin(origin)
    15     if #system_applications > 0 then
    16       r.member_id = app.session.member_id
    17       r.real_member_id = app.session.real_member_id
    18       if app.session.member.role then
    19         r.member_is_role = true
    20       end
    21     else
    22       local member_application = MemberApplication:by_member_id_and_origin(app.session.member_id, origin)
    23       if member_application then
    24         r.member_id = app.session.member_id
    25         r.real_member_id = app.session.real_member_id
    26       end
    27     end
    28   end
    29 end
    31 slot.put_into("data", json.export(r))
