summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2011-10-13 13:31:51 +0000
committerTed Trask <ttrask01@yahoo.com>2011-10-13 13:31:51 +0000
commitdb5d4047088b4d89cccd71d12eb75b116d3c9090 (patch)
tree5ca29613a46aafad8fb091059e182f0a1d50d9ec
parenta2e1425816cc3811d21a904b15dd453e13819dc2 (diff)
downloadacf-provisioning-db5d4047088b4d89cccd71d12eb75b116d3c9090.tar.bz2
acf-provisioning-db5d4047088b4d89cccd71d12eb75b116d3c9090.tar.xz
Fixed handling of Polycom -directory.xml files
-rwxr-xr-xcgi-bin/provisioning.cgi11
1 files changed, 6 insertions, 5 deletions
diff --git a/cgi-bin/provisioning.cgi b/cgi-bin/provisioning.cgi
index f374f4c..e8af6be 100755
--- a/cgi-bin/provisioning.cgi
+++ b/cgi-bin/provisioning.cgi
@@ -86,13 +86,13 @@ if ( request_method == "GET" ) then
os.exit()
end
- -- If it's a Polycom, 404 the MAC.cfg, MAC-directory.xml, and MAC-license files and redirect the MAC-phone.cfg and MAC-web.cfg files to blanks
+ -- If it's a Polycom, 404 the MAC.cfg and MAC-license files and redirect the MAC-directory.xml, MAC-phone.cfg, and MAC-web.cfg files to blanks
local f = string.match(basename, mac.."(.*)")
- if string.match(user_agent, "Polycom") and (f==".cfg" or f=="-directory.xml" or f=="-license.cfg" or mac=="000000000000") then
+ if string.match(user_agent, "Polycom") and (f==".cfg" or f=="-license.cfg" or mac=="000000000000") then
http_code(404)
log:close()
os.exit()
- elseif string.match(user_agent, "Polycom") and (f=="-phone.cfg" or f=="-web.cfg") then
+ elseif string.match(user_agent, "Polycom") and (f=="-directory.xml" or f=="-phone.cfg" or f=="-web.cfg") then
http_code(302)
log:close()
os.exit()
@@ -114,6 +114,7 @@ if ( request_method == "GET" ) then
if not data.errtxt and data.value.values and data.value.values.value.device and data.value.values.value.device.template then
local func = haserl.loadfile(data.value.values.value.device.template)
func(data.value.values.value)
+ log:write("Success\n")
else
http_code(404)
end
@@ -142,7 +143,7 @@ elseif ( request_method == "PUT" ) then
-- If it's a Polycom, do not pass the MAC-directory.xml file to ACF
-- Don't bother for .log files
local f = string.match(basename, mac.."(.*)")
- if not (string.match(user_agent, "Polycom") and f=="-directory.xml") and not string.match(path_info, "%.log$") then
+ if not string.match(path_info, "%.log$") then
log:write("Checking PROV Table for results\n")
-- Load the ACF mvc
local PATH = package.path
@@ -157,8 +158,8 @@ elseif ( request_method == "PUT" ) then
APP.view_resolver = function(self)
return function (output)
if output.errtxt then
+ log:write(output.errtxt.."\n")
success = false
- http_code(400)
else
data = output.value
end