X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhttp%2Fpages%2Finsertedfilespage.cpp;h=1fab7cd54ee724af93106e1eebc37e5d7b537836;hb=44f964d9b2b2d55a5b5672e9297717bd25fa8ee2;hp=c9d46842bf1c3a2d1acb9828b9b2a9e2ffe36236;hpb=52581afffd81f5a71c129d87e3ac822d9522f12d;p=fms.git
diff --git a/src/http/pages/insertedfilespage.cpp b/src/http/pages/insertedfilespage.cpp
index c9d4684..1fab7cd 100644
--- a/src/http/pages/insertedfilespage.cpp
+++ b/src/http/pages/insertedfilespage.cpp
@@ -10,25 +10,40 @@ const std::string InsertedFilesPage::GeneratePage(const std::string &method, con
{
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);
std::string fproxyport="8888";
Option::Instance()->Get("FProxyPort",fproxyport);
+
+ if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="removefile" && queryvars.find("fileid")!=queryvars.end())
+ {
+ SQLite3DB::Statement del=m_db->Prepare("DELETE FROM tblFileInserts WHERE FileInsertID=?;");
+ del.Bind(0,(*queryvars.find("fileid")).second);
+ del.Step();
+ }
+
+ SQLite3DB::Statement st=m_db->Prepare("SELECT Key,FileName,Size,FileInsertID FROM tblFileInserts WHERE Key IS NOT NULL ORDER BY FileName");
+ st.Step();
+
while(st.RowReturned())
{
std::string key="";
std::string filename="";
std::string sizestr="";
+ std::string insertidstr="";
st.ResultText(0,key);
st.ResultText(1,filename);
st.ResultText(2,sizestr);
+ st.ResultText(3,insertidstr);
content+=""+SanitizeOutput(filename)+" - "+sizestr+" bytes";
+ content+="";
content+="
";
st.Step();