Fixed the basic auth logout by using the ://foo@hostname... workaround.

Added support for ?destination=... so that login or logout will return to previous visited page.
Revisited the sending of generic response such as access denied, unauthorized, redirection ...
Fixed support of CMS_RESPONSE.header which was  previously ignored.
Added support for CMS_RESPONSE.redirection: detachable READABLE_STRING_8, to allow easy url redirection.
Added CMS_NODE.make_empty
+ Cosmetic.
This commit is contained in:
2015-04-09 23:54:14 +02:00
parent b235fb30a7
commit 20471923fd
12 changed files with 252 additions and 28 deletions

View File

@@ -1,6 +1,5 @@
note
description: "Summary description for {CMS_REQUEST_UTIL}."
author: ""
description: "Set of helper features related to CMS Request needs."
date: "$Date: 2015-02-13 13:08:13 +0100 (ven., 13 févr. 2015) $"
revision: "$Revision: 96616 $"
@@ -29,7 +28,7 @@ feature -- User
note
EIS: "eiffel:?class=AUTHENTICATION_FILTER&feature=execute"
do
if attached {CMS_USER} req.execution_variable ("_cms_active_user_") as l_user then
if attached {CMS_USER} req.execution_variable (current_user_execution_variable_name) as l_user then
Result := l_user
end
end
@@ -40,14 +39,27 @@ feature -- Change
-- Set `a_user' as `current_user'.
do
if a_user = Void then
req.unset_execution_variable ("_cms_active_user_")
req.unset_execution_variable (current_user_execution_variable_name)
else
req.set_execution_variable ("_cms_active_user_", a_user)
req.set_execution_variable (current_user_execution_variable_name, a_user)
end
ensure
user_set: current_user (req) ~ a_user
end
unset_current_user (req: WSF_REQUEST)
-- Unset current user.
do
req.unset_execution_variable (current_user_execution_variable_name)
ensure
user_unset: current_user (req) = Void
end
feature {NONE} -- Implementation: current user
current_user_execution_variable_name: STRING = "_cms_active_user_"
-- Execution variable name used to keep current user data.
feature -- Media Type
current_media_type (req: WSF_REQUEST): detachable READABLE_STRING_32