From a2e1425816cc3811d21a904b15dd453e13819dc2 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 12 Oct 2011 12:57:13 +0000 Subject: Polycom -directory files are handled differently on upload --- cgi-bin/provisioning.cgi | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cgi-bin/provisioning.cgi b/cgi-bin/provisioning.cgi index 640294a..f374f4c 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, MAC-directory.xml, and MAC-license files and redirect the 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=="-directory.xml" 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=="-phone.cfg" or f=="-web.cfg") then http_code(302) log:close() os.exit() @@ -139,8 +139,10 @@ elseif ( request_method == "PUT" ) then os.exit() end + -- If it's a Polycom, do not pass the MAC-directory.xml file to ACF -- Don't bother for .log files - if not string.match(path_info, "%.log$") then + 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 log:write("Checking PROV Table for results\n") -- Load the ACF mvc local PATH = package.path -- cgit v1.2.3