From 04503eb37544a0af28b0be1b4849c922ff2e25c8 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 30 May 2014 19:10:16 +0000 Subject: Fix http(s) getlogcandidates to work with acf-alpine-baselayout-0.12.0 --- weblog-model.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'weblog-model.lua') diff --git a/weblog-model.lua b/weblog-model.lua index eca067a..3b3cc40 100644 --- a/weblog-model.lua +++ b/weblog-model.lua @@ -638,9 +638,18 @@ local getlogcandidates = function(source, cookiesfile) local candidates = {} if source.method == "http" or source.method == "https" then local resultpage = modelfunctions.run_executable({"wget", "-O", "-", "--no-check-certificate", "--load-cookies", cookiesfile, source.method.."://"..source.source.."/cgi-bin/acf/alpine-baselayout/logfiles/status"}) + -- This method works for view prior to acf-alpine-baselayout-0.12.0 for file in string.gmatch(resultpage, "download%?[^\"]*name=([^\"]+)") do candidates[#candidates+1] = file end + -- This method works for view from acf-alpine-baselayout-0.12.0 + local reversetable = {} + for file in string.gmatch(resultpage, 'name="filename" value="([^\"]+)"') do + if not reversetable[file] then + candidates[#candidates+1] = file + reversetable[file] = true + end + end elseif source.method == "local" then candidates = fs.find_files_as_array(nil, source.source) end -- cgit v1.2.3