diff options
author | Ted Trask <ttrask01@yahoo.com> | 2012-02-23 14:45:15 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2012-02-23 14:45:15 +0000 |
commit | 091862516c4d4bc80eb741101fcd670ed4009ec7 (patch) | |
tree | 2253f74c4f60d7b630a8be32245b145f9dda96b7 | |
parent | 6ec4d53a6c8faf536f75bf6159aa671ae230c48c (diff) | |
download | acf-provisioning-091862516c4d4bc80eb741101fcd670ed4009ec7.tar.bz2 acf-provisioning-091862516c4d4bc80eb741101fcd670ed4009ec7.tar.xz |
Updates to provisioning.cgi to reflect changes in acf-core-0.15
-rwxr-xr-x | cgi-bin/provisioning.cgi | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/cgi-bin/provisioning.cgi b/cgi-bin/provisioning.cgi index e4c9303..1f86aa6 100755 --- a/cgi-bin/provisioning.cgi +++ b/cgi-bin/provisioning.cgi @@ -118,11 +118,9 @@ if ( request_method == "GET" ) then log:write("Checking PROV Table for results\n") -- Load the ACF mvc mvc = require("acf.mvc") - -- We'll use the cli controller, but change the view resolver to call the template - local pathinfo = ENV.PATH_INFO - FRAMEWORK=mvc:new() - FRAMEWORK:read_config("acf") - APP=FRAMEWORK:new("acf_cli") + -- We'll change the view resolver to call the template + APP=mvc:new() + APP:read_config("acf") APP.view_resolver = function(self) return function (data) if not data.errtxt and data.value.values and data.value.values.value.device and data.value.values.value.device.template then @@ -134,15 +132,11 @@ if ( request_method == "GET" ) then end end end - -- Set up the action and parameters - ENV.PATH_INFO = "/provisioning/provisioning/getfile" - APP.clientdata = {mac=mac, ip=ip_address, agent=user_agent} + -- Set up the parameters + local clientdata = {mac=mac, ip=ip_address, agent=user_agent} -- Dispatch the command - APP:dispatch() + APP:dispatch("/provisioning/", "provisioning", "getfile", clientdata) APP:destroy() - FRAMEWORK:destroy() - - ENV.PATH_INFO = pathinfo elseif ( request_method == "PUT" ) then local data = io.stdin:read("*all") local success = true @@ -161,11 +155,9 @@ elseif ( request_method == "PUT" ) then log:write("Checking PROV Table for results\n") -- Load the ACF mvc mvc = require("acf.mvc") - -- We'll use the cli controller, but change the view resolver to report HTTP code - local pathinfo = ENV.PATH_INFO - FRAMEWORK=mvc:new() - FRAMEWORK:read_config("acf") - APP=FRAMEWORK:new("acf_cli") + -- We'll change the view resolver to report HTTP code + APP=mvc:new() + APP:read_config("acf") APP.view_resolver = function(self) return function (output) if output.errtxt then @@ -177,14 +169,10 @@ elseif ( request_method == "PUT" ) then end end -- Set up the action and parameters - ENV.PATH_INFO = "/provisioning/provisioning/putfile" - APP.clientdata = {mac=mac, data=data} + local clientdata = {mac=mac, data=data} -- Dispatch the command - APP:dispatch() + APP:dispatch("/provisioning/", "provisioning", "putfile", clientdata) APP:destroy() - FRAMEWORK:destroy() - - ENV.PATH_INFO = pathinfo end if success then local path = root..path_info |