<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%
include("checklogin.html")
include("language.html")

if _SESSION["username"] ~= nil and _SESSION["currentpath"] ~= nil then
	local dirname = _GET["dir"]
	local filename = _GET["filename"]

	local nowdir = string.gsub(_SESSION["currentpath"],":{{","%[")
	nowdir = string.gsub(nowdir,"}}:","%]")

	if dirname == nil or dirname == "" or filename == nil or filename == "" then
		print("<script>alert('"..LANG["error_no_filename"].."');top.closewindow();</script>")
		exit();
	end
%>
</head>
<body>
<div><audio style='width:98%;margin-top:100px;' src='/?download&filename=<%=urlencode(filename)%>&nowpath=<%=urlencode(dirname)%>&UID=<%=_SESSION_ID%>' autoplay controls>Your browser doesn't support HTML5 audio!</audio></div>
</body>
</html>

<% 
else
	print("<script>alert('"..LANG["session_expire"].."');top.window.location = 'logout.html';</script>")
end 
%>
<noscript><H2><%=LANG["error_nojavascript"]%></H2></noscript>