<%
include("language.html")

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

	local status,liststr = c_GetDirectoryList(_SESSION["username"],nowdir)
	if status == 1 then
		rawset(_SESSION,"keeplive",1)
		SessionModule.save(_SESSION_ID)

		c_AddConnection(_SESSION["username"],nowdir,_REMOTE_IP,_SESSION_ID,"LIST")
		c_AddWebLog("List ok",_SESSION_ID,DOMAIN_LOG_WEB_COMMAND)
		print(liststr)
	end
else
	print("session expired")
end

%>
