Updated CMS libary:

Initial Basic Authentication Node with filters.
Updated ROC API to use the new module.
This commit is contained in:
jvelilla
2014-10-02 20:52:14 -03:00
parent a0cb7c0ecc
commit 3fe166b768
17 changed files with 41 additions and 41 deletions

View File

@@ -62,7 +62,7 @@ feature -- Configure Node Resources Routes
create l_bal_handler.make (config)
create l_methods
l_methods.enable_get
router.handle_with_request_methods ("/basic_auth/login", l_bal_handler, l_methods)
router.handle_with_request_methods ("/basic_auth_login", l_bal_handler, l_methods)
end
configure_api_logoff
@@ -73,7 +73,7 @@ feature -- Configure Node Resources Routes
create l_bal_handler.make (config)
create l_methods
l_methods.enable_get
router.handle_with_request_methods ("/basic_auth/logoff", l_bal_handler, l_methods)
router.handle_with_request_methods ("/basic_auth_logoff", l_bal_handler, l_methods)
end
end

View File

@@ -52,7 +52,7 @@ feature -- HTTP Methods
do
log.write_information(generator + ".do_get Processing basic auth login")
if attached {STRING_32} current_user_name (req) as l_user then
(create {CMS_GENERIC_RESPONSE}).new_response_redirect (req, res, req.absolute_script_url(""))
(create {CMS_GENERIC_RESPONSE}).new_response_redirect (req, res, req.absolute_script_url("/"))
else
(create {CMS_GENERIC_RESPONSE}).new_response_authenticate (req, res)
end

View File

@@ -71,7 +71,7 @@ feature -- HTTP Methods
if attached {WSF_STRING} req.path_parameter ("id") as l_id then
if l_id.is_integer and then attached {CMS_NODE} api_service.node (l_id.integer_value) as l_node then
create {GENERIC_VIEW_CMS_RESPONSE} l_page.make (req, res, setup, "modules/node_content")
l_page.add_variable (l_node.content, "content")
l_page.add_variable (l_node.content, "node_content")
l_page.add_variable (l_id.value, "id")
l_page.execute
else

View File

@@ -70,8 +70,8 @@ feature -- HTTP Methods
if attached {WSF_STRING} req.path_parameter ("id") as l_id then
if l_id.is_integer and then attached {CMS_NODE} api_service.node (l_id.integer_value) as l_node then
create {GENERIC_VIEW_CMS_RESPONSE} l_page.make (req, res, setup, "modules/node_summary")
l_page.add_variable (l_node.summary, "summary")
l_page.add_variable (l_id.value, "id")
l_page.add_variable (l_node.summary, "node_summary")
l_page.execute
else
do_error (req, res, l_id)

View File

@@ -70,20 +70,14 @@ feature -- HTTP Methods
if attached {WSF_STRING} req.path_parameter ("id") as l_id then
if l_id.is_integer and then attached {CMS_NODE} api_service.node (l_id.integer_value) as l_node then
create {GENERIC_VIEW_CMS_RESPONSE} l_page.make (req, res, setup, "modules/node_title")
l_page.add_variable (setup.is_html, "html")
l_page.add_variable (setup.is_web, "web")
l_page.add_variable (l_node.title, "title")
l_page.add_variable (l_node.title, "node_title")
l_page.add_variable (l_id.value, "id")
l_page.execute
else
do_error (req, res, l_id)
end
else
to_implement ("Check how to implement API error")
-- create l_page.make (req, "master2/error")
-- l_page.set_value ("500", "code")
-- l_page.set_value (req.absolute_script_url (req.path_info), "request")
-- l_page.send_to (res)
(create {ERROR_500_CMS_RESPONSE}.make (req, res, setup, "master2/error")).execute
end
else
(create {CMS_GENERIC_RESPONSE}).new_response_unauthorized (req, res)