Fixed and improved various issue in admin module (especially the Role editing which was not working as expected.)
Added CMS_MODULE.permissions to allow module to declare the potential permissions. Added support for CMS_LINK.is_forbidden, in relation with CMS_LOCAL_LINK.permission_arguments. Split link "username (Logout)" into 2 links "username" and "logout". Fixed/Changed the way auth modules alter the logout link based on "(Logout)" title, by safer solution based on `location' of the link. Fixed usage of WSF_REQUEST.path_info by using percent_encoded_path_info which is not non unicode path info to be used most of the time. Merged CMS_REPONSE.variables and CMS_REPONSE.values . When possible, prefer usage of CMS_RESPONSE.user instead of CMS_REQUEST_UTIL.current_user (WSF_REQUEST) whenever it is possible. When possible, prefer usage of CMS_RESPONSE.location, rather than usage of WSF_REQUEST.(percent_encoded_)path_info . Code cleaning.
This commit is contained in:
@@ -114,7 +114,7 @@ feature -- Hooks
|
||||
value_table_alter (a_value: CMS_VALUE_TABLE; a_response: CMS_RESPONSE)
|
||||
-- <Precursor>
|
||||
do
|
||||
if attached current_user (a_response.request) as l_user then
|
||||
if a_response.is_authenticated then
|
||||
a_value.force ("basic_auth_logoff", "auth_login_strategy")
|
||||
end
|
||||
end
|
||||
@@ -126,13 +126,13 @@ feature -- Hooks
|
||||
lnk: CMS_LOCAL_LINK
|
||||
lnk2: detachable CMS_LINK
|
||||
do
|
||||
if attached a_response.current_user (a_response.request) as u then
|
||||
if attached a_response.user as u then
|
||||
across
|
||||
a_menu_system.primary_menu.items as ic
|
||||
until
|
||||
lnk2 /= Void
|
||||
loop
|
||||
if ic.item.title.has_substring ("(Logout)") then
|
||||
if ic.item.location.same_string ("account/roc-logout") then
|
||||
lnk2 := ic.item
|
||||
end
|
||||
end
|
||||
@@ -141,7 +141,7 @@ feature -- Hooks
|
||||
a_menu_system.primary_menu.remove (lnk2)
|
||||
end
|
||||
|
||||
create lnk.make (u.name + " (Logout)", "basic_auth_logoff" )
|
||||
create lnk.make ("Logout", "basic_auth_logoff")
|
||||
lnk.set_weight (98)
|
||||
a_menu_system.primary_menu.extend (lnk)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user