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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user