summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcgi-bin/provisioning.cgi13
1 files changed, 11 insertions, 2 deletions
diff --git a/cgi-bin/provisioning.cgi b/cgi-bin/provisioning.cgi
index f0de432..640294a 100755
--- a/cgi-bin/provisioning.cgi
+++ b/cgi-bin/provisioning.cgi
@@ -43,6 +43,11 @@ function http_code (code)
elseif code == 204 then
io.stdout:write("Status: 204 No Content\n")
io.stdout:write("Content-Type: \n\n")
+ elseif code == 302 then
+ -- redirect to same file with empty mac
+ io.stdout:write("Location: " .. string.gsub(path_info, "%x%x%x%x%x%x%x%x%x%x%x%x", "000000000000") .. "\n")
+ io.stdout:write("Content-Type: \n\n")
+ io.stdout:write("<a href=\"".. string.gsub(path_info, "%x%x%x%x%x%x%x%x%x%x%x%x", "000000000000") .."\">New Link</a>")
elseif code == 404 then
io.stdout:write("Status: 404 Not Found\n")
io.stdout:write("Content-Type: \n\n")
@@ -81,12 +86,16 @@ if ( request_method == "GET" ) then
os.exit()
end
- -- If it's a Polycom, 404 the MAC.cfg, MAC-directory.xml, MAC-license, MAC-phone.cfg, and MAC-web.cfg files
+ -- 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 f=="-phone.cfg" or f=="-web.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
+ http_code(302)
+ log:close()
+ os.exit()
end
log:write("Checking PROV Table for results\n")