<%
include("language.html")

local begin = _POST["begin"] or _GET["begin"] or nil
local searchin = _POST["searchin"] or _GET["searchin"] or nil
local searchfor = _POST["searchfor"] or _GET["searchfor"] or nil

if _SESSION["username"] ~= nil and searchin ~= nil then
	setContentType("text/xml; charset=UTF-8")
	local nowdir = string.gsub(searchin,":{{","%[")
	nowdir = string.gsub(nowdir,"}}:","%]")

	if begin ~= nil and searchfor ~= nil then
		c_AddWebLog("Start searching for '"..searchfor.."' in the directory '"..searchin.."' ",_SESSION_ID,DOMAIN_LOG_WEB_COMMAND)
	end

	local status,liststr = c_GetDirectoryList(_SESSION["username"],nowdir)
	if status == 1 then
		print(liststr)
	end
else
	print("session expired")
end

%>
