<% include("language.html") if _SESSION["username"] ~= nil and _SESSION["currentpath"] ~= nil then local filename = _GET["filename"] or _POST["filename"] or nil local expiretime = _GET["expiretime"] or _POST["expiretime"] or "" local uploadpass = _GET["uploadpass"] or _POST["uploadpass"] or "" local notify = _GET["notify"] or _POST["notify"] or "" local sendmail = _GET["sendmail"] or _POST["sendmail"] or "" local mailaddress = _GET["mailaddress"] or _POST["mailaddress"] or "" local sender_mailaddress = _GET["sender_mailaddress"] or _POST["sender_mailaddress"] or "" local mail_message = _GET["mail_message"] or _POST["mail_message"] or "" local localaddress = _GET["localaddress"] or _POST["localaddress"] or "" local nowdir = _GET["nowdir"] or _POST["nowdir"] or nil if nowdir == nil then nowdir = string.gsub(_SESSION["currentpath"],":{{","%[") nowdir = string.gsub(nowdir,"}}:","%]") end if filename ~= nil then local result = c_UpdateUploadLink(_SESSION["username"], filename, nowdir, expiretime, uploadpass, mailaddress, sender_mailaddress) if result ~= "" and result ~= "noperm" then c_AddWebLog("User '".._SESSION["username"].."' updated Upload-Link for the folder '"..nowdir.."/"..filename.."'",_SESSION_ID,DOMAIN_LOG_WEB_RESPOND) if sendmail == "yes" and mailaddress ~= "" and localaddress ~= "" then local UploadLink = Split(c_GetUploadLink(_SESSION["username"],filename,nowdir), "\r\n") local url = specialhtml_encode(localaddress).."/uploadlink.html?linkid="..UploadLink[1] local urltext = specialhtml_encode(localaddress).."/uploadlink.html?linkid="..UploadLink[1] local subject = LANG["request_file_tip"].." (Wing FTP Server)" if sender_mailaddress == "" then subject = _SESSION["username"].." "..subject else subject = specialhtml_encode(sender_mailaddress).." "..subject end local message = "" if mail_message ~= "" then local msg = specialhtml_encode(mail_message) msg = msg.gsub(msg, "\n", "
") message = ""..LANG["str_field_message"]..":"..msg.."" end local content = [[ Wing FTP Server - File Request

]]..message..[[
]]..LANG["upload_title"]..[[:]]..urltext..[[
]]..LANG["password"]..[[]]..specialhtml_encode(uploadpass)..[[
]]..LANG["upload_title"]..[[
]] local result = c_SendMessage(mailaddress, subject, content, true, sender_mailaddress) if result == false then print("Error: sending email") else print("operation successful") end end else print("Error: no permission") end else print("") end end %>