Cleaned demo.ecf

Fixed modules admin handler permission checking from "admin.installation_access" to "administration.installation_access".
Use constants for known form id.
Invoke hook form alter for user view response.
Include theme when installing roc cms library.
This commit is contained in:
Jocelyn Fiat
2017-09-11 22:31:23 +02:00
parent 5f7eb82def
commit 6b4668ec6b
11 changed files with 209 additions and 18 deletions

View File

@@ -157,7 +157,7 @@ feature -- Hook
do
if
attached a_form.id as fid and then
fid.same_string ("roccms-user-view")
fid.same_string ("roccms-user-view") -- Check {CMS_AUTHENTICATION_MODULE}.view_account_form_id
then
if
attached a_response.user as u and then

View File

@@ -56,6 +56,7 @@ feature -- Process
or l_user.same_as (user) -- Same user
then
f := new_view_form (l_user, request.request_uri, "view-user")
api.hooks.invoke_form_alter (f, Void, Current)
f.append_to_html (wsf_theme, b)
else
b.append ("You don't have the permission to view this user!")
@@ -68,6 +69,8 @@ feature -- Process
feature -- Process Edit
view_user_form_id: STRING = "view-user"
new_view_form (a_user: detachable CMS_USER; a_url: READABLE_STRING_8; a_name: STRING): CMS_FORM
-- Create a web form named `a_name' for user `a_user' (if set), using form action url `a_url'.
local

View File

@@ -29,6 +29,13 @@ feature -- API Service
api: CMS_API
feature -- Response factory
new_generic_response (req: WSF_REQUEST; res: WSF_RESPONSE): CMS_RESPONSE
do
create {GENERIC_VIEW_CMS_RESPONSE} Result.make (req, res, api)
end
feature -- Response message helpers
redirect_to (a_location: READABLE_STRING_8; res: WSF_RESPONSE)