bsw/jbe@1309: if not request.is_post() then bsw/jbe@1309: return execute.view { module = "index", view = "405" } bsw/jbe@1309: end bsw/jbe@1309: bsw/jbe@1309: slot.set_layout(nil, "application/json") bsw/jbe@1309: bsw/jbe@1309: local r = json.object{ bsw/jbe@1309: member_id = json.null bsw/jbe@1309: } bsw/jbe@1309: bsw@1538: if app.session and app.session.member_id then bsw/jbe@1309: local origin = request.get_header("Origin") bsw/jbe@1309: if origin then bsw/jbe@1309: local system_applications = SystemApplication:by_origin(origin) bsw/jbe@1309: if #system_applications > 0 then bsw/jbe@1309: r.member_id = app.session.member_id bsw/jbe@1309: r.real_member_id = app.session.real_member_id bsw/jbe@1309: if app.session.member.role then bsw/jbe@1309: r.member_is_role = true bsw/jbe@1309: end bsw/jbe@1309: else bsw/jbe@1309: local member_application = MemberApplication:by_member_id_and_origin(app.session.member_id, origin) bsw/jbe@1309: if member_application then bsw/jbe@1309: r.member_id = app.session.member_id bsw/jbe@1309: r.real_member_id = app.session.real_member_id bsw/jbe@1309: end bsw/jbe@1309: end bsw/jbe@1309: end bsw/jbe@1309: end bsw/jbe@1309: bsw/jbe@1309: slot.put_into("data", json.export(r)) bsw/jbe@1309: