Move libraries layout', model', `peristence' under cms folder
Updated code to the new layout. Added missing comments. Remove /example/api
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
note
|
||||
description: "Summary description for {BASIC_AUTH_MODULE}."
|
||||
description: "This module allows the use of HTTP Basic Authentication to restrict access by looking up users in the given providers."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
note
|
||||
description: "Summary description for {BASIC_AUTH_FILTER}."
|
||||
author: ""
|
||||
description: "Processes a HTTP request's BASIC authorization headers, putting the result into the execution variable user."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
@@ -19,7 +18,7 @@ create
|
||||
feature -- Basic operations
|
||||
|
||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
-- Execute the filter
|
||||
-- Execute the filter.
|
||||
local
|
||||
l_auth: HTTP_AUTHORIZATION
|
||||
do
|
||||
@@ -33,10 +32,17 @@ feature -- Basic operations
|
||||
attached l_auth.login as l_auth_login and then attached l_auth.password as l_auth_password then
|
||||
if api.is_valid_credential (l_auth_login, l_auth_password) then
|
||||
if attached api.user_by_name (l_auth_login) as l_user then
|
||||
debug ("refactor_fixme")
|
||||
fixme ("Maybe we need to store in the credentials in a shared context SECURITY_CONTEXT")
|
||||
-- req.set_execution_variable ("security_content", create SECURITY_CONTEXT.make (l_user))
|
||||
-- other authentication filters (OpenID, etc) should implement the same approach.
|
||||
end
|
||||
req.set_execution_variable ("user", l_user)
|
||||
execute_next (req, res)
|
||||
else
|
||||
-- Internal server error
|
||||
debug ("refactor_fixme")
|
||||
to_implement ("Internal server error")
|
||||
end
|
||||
end
|
||||
else
|
||||
log.write_error (generator + ".execute login_valid failed for: " + l_auth_login )
|
||||
|
||||
@@ -1,22 +1,31 @@
|
||||
note
|
||||
description: "Summary description for {WSF_CMS_MODULE}."
|
||||
description: "Describe module features that adds one or more features to your web site."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
CMS_MODULE
|
||||
|
||||
inherit
|
||||
|
||||
REFACTORING_HELPER
|
||||
|
||||
feature -- Access
|
||||
|
||||
is_enabled: BOOLEAN
|
||||
-- Is the module enabled?
|
||||
|
||||
name: STRING
|
||||
-- Name of the module.
|
||||
|
||||
description: STRING
|
||||
-- Description of the module.
|
||||
|
||||
package: STRING
|
||||
--
|
||||
|
||||
version: STRING
|
||||
-- Version od the module?
|
||||
|
||||
feature -- Router
|
||||
|
||||
@@ -48,21 +57,29 @@ feature -- Filter
|
||||
feature -- Settings
|
||||
|
||||
enable
|
||||
-- enable the module.
|
||||
do
|
||||
is_enabled := True
|
||||
ensure
|
||||
module_enabled: is_enabled
|
||||
end
|
||||
|
||||
disable
|
||||
-- disable the module.
|
||||
do
|
||||
is_enabled := False
|
||||
ensure
|
||||
module_disbaled: not is_enabled
|
||||
end
|
||||
|
||||
feature -- Hooks
|
||||
|
||||
help_text (a_path: STRING): STRING
|
||||
do
|
||||
debug ("refactor_fixme")
|
||||
to_implement ("Add the corresponing implementation.")
|
||||
end
|
||||
create Result.make_empty
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user