X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Finsertedfilespage.cpp;h=1fab7cd54ee724af93106e1eebc37e5d7b537836;hb=44f964d9b2b2d55a5b5672e9297717bd25fa8ee2;hp=13abc3d9eab2cdf8a91ebe954221e33fff2bf065;hpb=63376b2a82c3f6cdf2df56b1f134bd7df0aaab3a;p=fms.git
diff --git a/src/http/pages/insertedfilespage.cpp b/src/http/pages/insertedfilespage.cpp
index 13abc3d..1fab7cd 100644
--- a/src/http/pages/insertedfilespage.cpp
+++ b/src/http/pages/insertedfilespage.cpp
@@ -10,23 +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+=""+SanitizeOutput(filename)+" - "+sizestr+" bytes";
+ content+="";
content+="
";
st.Step();