X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Finsertedfilespage.cpp;fp=src%2Fhttp%2Fpages%2Finsertedfilespage.cpp;h=13abc3d9eab2cdf8a91ebe954221e33fff2bf065;hb=63376b2a82c3f6cdf2df56b1f134bd7df0aaab3a;hp=0000000000000000000000000000000000000000;hpb=e773b0ecb8a35c67cde5b2e82bbebb05224f34d0;p=fms.git diff --git a/src/http/pages/insertedfilespage.cpp b/src/http/pages/insertedfilespage.cpp new file mode 100644 index 0000000..13abc3d --- /dev/null +++ b/src/http/pages/insertedfilespage.cpp @@ -0,0 +1,48 @@ +#include "../../../include/http/pages/insertedfilespage.h" +#include "../../../include/stringfunctions.h" +#include "../../../include/option.h" + +#ifdef XMEM + #include +#endif + +const std::string InsertedFilesPage::GeneratePage(const std::string &method, const std::map &queryvars) +{ + std::string content="

Inserted Files

"; + + SQLite3DB::Statement st=m_db->Prepare("SELECT Key,FileName,Size FROM tblFileInserts WHERE Key IS NOT NULL ORDER BY FileName"); + st.Step(); + + std::string node="localhost"; + Option::Instance()->Get("FCPHost",node); + + while(st.RowReturned()) + { + std::string key=""; + std::string filename=""; + std::string sizestr=""; + + st.ResultText(0,key); + st.ResultText(1,filename); + st.ResultText(2,sizestr); + + content+=""+SanitizeOutput(filename)+" - "+sizestr+" bytes"; + content+="
"; + + st.Step(); + } + + return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"+StringFunctions::Replace(m_template,"[CONTENT]",content); +} + +const bool InsertedFilesPage::WillHandleURI(const std::string &uri) +{ + if(uri.find("insertedfiles.")!=std::string::npos) + { + return true; + } + else + { + return false; + } +}