note description: "Summary description for {ES_CLOUD_HANDLER}." date: "$Date$" revision: "$Revision$" class ES_CLOUD_HANDLER inherit CMS_HANDLER rename make as make_with_cms_api end WSF_URI_TEMPLATE_HANDLER create make feature {NONE} -- Initialization make (a_mod_api: ES_CLOUD_API) do make_with_cms_api (a_mod_api.cms_api) es_cloud_api := a_mod_api end feature -- API es_cloud_api: ES_CLOUD_API feature -- Execution execute (req: WSF_REQUEST; res: WSF_RESPONSE) -- Execute handler for `req' and respond in `res'. local l_uid: READABLE_STRING_GENERAL do if req.is_get_request_method then get_cloud (req, res) -- elseif req.is_post_request_method then else send_bad_request (req, res) end end get_cloud (req: WSF_REQUEST; res: WSF_RESPONSE) local r: like new_generic_response s: STRING l_plan: detachable ES_CLOUD_PLAN do r := new_generic_response (req, res) r.set_title ("EiffelStudio account") s := "" if attached api.user as u then s.append ("

User "+ api.html_encoded (api.real_user_display_name (u)) +"

") -- Plan -- Installation ... s.append ("
") if attached es_cloud_api.user_installations (u) as l_installations and then not l_installations.is_empty then s.append ("

EiffelStudio is installed on:

") else s.append ("

EiffelStudio is not yet installed.

") end s.append ("
") s.append ("
") if attached es_cloud_api.user_subscription (u) as sub then l_plan := sub.plan s.append ("

You are subscribed to plan: ") s.append (html_encoded (l_plan.title_or_name)) s.append ("") s.append ("

") else s.append ("Please subscribe to a plan ...") end s.append ("
") else s.append ("

Please Login or Register...

") end if l_plan = Void then s.append ("
") s.append ("Plans") s.append ("
") end r.set_main_content (s) r.execute end note copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" end