1 #include "../../../include/http/pages/insertedfilespage.h"
\r
2 #include "../../../include/stringfunctions.h"
\r
3 #include "../../../include/option.h"
\r
9 const std::string InsertedFilesPage::GeneratePage(const std::string &method, const std::map<std::string,std::string> &queryvars)
\r
11 std::string content="<h2>Inserted Files</h2>";
\r
13 SQLite3DB::Statement st=m_db->Prepare("SELECT Key,FileName,Size FROM tblFileInserts WHERE Key IS NOT NULL ORDER BY FileName");
\r
16 std::string node="localhost";
\r
17 Option::Instance()->Get("FCPHost",node);
\r
18 std::string fproxyport="8888";
\r
19 Option::Instance()->Get("FProxyPort",fproxyport);
\r
21 while(st.RowReturned())
\r
24 std::string filename="";
\r
25 std::string sizestr="";
\r
27 st.ResultText(0,key);
\r
28 st.ResultText(1,filename);
\r
29 st.ResultText(2,sizestr);
\r
31 content+="<a href=\"http://"+node+":"+fproxyport+"/"+StringFunctions::UriEncode(key)+"\">"+SanitizeOutput(filename)+"</a> - "+sizestr+" bytes";
\r
37 return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"+StringFunctions::Replace(m_template,"[CONTENT]",content);
\r
40 const bool InsertedFilesPage::WillHandleURI(const std::string &uri)
\r
42 if(uri.find("insertedfiles.")!=std::string::npos)
\r