diff --git a/web/CXM_making_a_web_site.anubis b/web/CXM_making_a_web_site.anubis index 10574b3..ea9c5a6 100644 --- a/web/CXM_making_a_web_site.anubis +++ b/web/CXM_making_a_web_site.anubis @@ -65,6 +65,8 @@ transmit CXM_web_arg_utils.anubis transmit CXM_web_session.anubis transmit CXM_web_action.anubis +transmit calexium_lib/web/types/web_action_name.anubis + //read CXM_html_tooltip.anubis * (1) Structure of a web site. @@ -3025,48 +3027,52 @@ define WEB_Controller_Result { [] then http_answer(error_page(http_not_found, "No action found", _session)), [h . t] then - with action_name = if h.name is + if h.name = no_action then + http_answer( _session, html_content(http_no_content, empty)) + else + with action_name = if h.name is { + no_action then "", controller_action(_, name) then name, action_name(name) then name, url(url) then url, }, - if requested_action_name = action_name then - with step = get_Int(_session.fields, "AWS_SESSION_STEP", 0) + 1, - replace_Int(_session.fields, "AWS_SESSION_STEP", step); - if h.allowed_proto is - { - //Action only in HTTP - http then - if _session.web_request.is_https then - http_answer(error_page(http_forbidden, "Only HTTP authorized", _session)) - else - //ask to the server the authorization to execute that action - if h.allow(_session) then - h.do_it(_session) - else - http_answer(error_page(http_unauthorized, "you are not authorized for this action", _session)) - - //Action only in HTTPS - https then - if _session.web_request.is_https then - //ask to the server the authorization to execute that action - if h.allow(_session) then - h.do_it(_session) - else - http_answer(error_page(http_unauthorized, "you are not authorized for this action", _session)) - else - http_answer(error_page(http_forbidden, "Only HTTPS authorized", _session)) - //Action in both HTTP / HTTPS - http_https then - //ask to the server the authorization to execute that action - if h.allow(_session) then - //println("do_it "+action_name); - h.do_it(_session) - else - http_answer(error_page(http_unauthorized, "you are not authorized for this action", _session)) - - } + if requested_action_name = action_name then + with step = get_Int(_session.fields, "AWS_SESSION_STEP", 0) + 1, + replace_Int(_session.fields, "AWS_SESSION_STEP", step); + if h.allowed_proto is + { + //Action only in HTTP + http then + if _session.web_request.is_https then + http_answer(error_page(http_forbidden, "Only HTTP authorized", _session)) + else + //ask to the server the authorization to execute that action + if h.allow(_session) then + h.do_it(_session) + else + http_answer(error_page(http_unauthorized, "you are not authorized for this action", _session)) + + //Action only in HTTPS + https then + if _session.web_request.is_https then + //ask to the server the authorization to execute that action + if h.allow(_session) then + h.do_it(_session) + else + http_answer(error_page(http_unauthorized, "you are not authorized for this action", _session)) + else + http_answer(error_page(http_forbidden, "Only HTTPS authorized", _session)) + //Action in both HTTP / HTTPS + http_https then + //ask to the server the authorization to execute that action + if h.allow(_session) then + //println("do_it "+action_name); + h.do_it(_session) + else + http_answer(error_page(http_unauthorized, "you are not authorized for this action", _session)) + + } else apply_action(_session, requested_action_name, t) } @@ -3695,6 +3701,7 @@ public define String )= if action is { + no_action then "", controller_action(controller, action_name) then "?aws_controller="+controller+"&aws_action="+action_name, action_name(action_name) then "?aws_action="+action_name, url(url) then url @@ -4234,6 +4241,7 @@ define Printable_tree img_link(options, img, alt_text) then //if action name is empty, format options on image because maybe there onclick action with action_name = if action is { + no_action then "" controller_action(_, an) then an, action_name(an) then an, url(_) then "" @@ -4259,6 +4267,7 @@ define Printable_tree with action_name = if action is { + no_action then "", controller_action(_, an) then an, action_name(an) then an, url(_) then "" @@ -4304,6 +4313,7 @@ define Printable_tree ], javascript(s,h) then with action_name = if action is { + no_action then "", controller_action(_, an) then an, action_name(an) then an, url(_) then "" diff --git a/web/CXM_web_action.anubis b/web/CXM_web_action.anubis index 5e6e1dc..912c7de 100644 --- a/web/CXM_web_action.anubis +++ b/web/CXM_web_action.anubis @@ -7,16 +7,16 @@ */ -public type WEB_Action_Name: - controller_action( - String controller, - String action_name - ), - action_name( - String action_name - ), - //url is raw action, hence we will only copy that url in final link - url( - String url_name - ) -. +//public type WEB_Action_Name: +// controller_action( +// String controller, +// String action_name +// ), +// action_name( +// String action_name +// ), +// //url is raw action, hence we will only copy that url in final link +// url( +// String url_name +// ) +//. -- libgit2 0.21.4