X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Finsertedfilespage.cpp;h=dbd27b0f51df7c537340f34d591877924e4802c9;hb=59a5414ec47a2932a7802fcd1d98c4d80166564f;hp=1fab7cd54ee724af93106e1eebc37e5d7b537836;hpb=44f964d9b2b2d55a5b5672e9297717bd25fa8ee2;p=fms.git diff --git a/src/http/pages/insertedfilespage.cpp b/src/http/pages/insertedfilespage.cpp index 1fab7cd..dbd27b0 100644 --- a/src/http/pages/insertedfilespage.cpp +++ b/src/http/pages/insertedfilespage.cpp @@ -10,13 +10,13 @@ const std::string InsertedFilesPage::GeneratePage(const std::string &method, con { std::string content="

Inserted Files

"; + Option option(m_db); std::string node="localhost"; - Option::Instance()->Get("FCPHost",node); + option.Get("FCPHost",node); std::string fproxyport="8888"; - Option::Instance()->Get("FProxyPort",fproxyport); + option.Get("FProxyPort",fproxyport); - - if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="removefile" && queryvars.find("fileid")!=queryvars.end()) + if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="removefile" && queryvars.find("fileid")!=queryvars.end() && ValidateFormPassword(queryvars)) { SQLite3DB::Statement del=m_db->Prepare("DELETE FROM tblFileInserts WHERE FileInsertID=?;"); del.Bind(0,(*queryvars.find("fileid")).second); @@ -40,6 +40,7 @@ const std::string InsertedFilesPage::GeneratePage(const std::string &method, con content+=""+SanitizeOutput(filename)+" - "+sizestr+" bytes"; content+="
"; + content+=CreateFormPassword(); content+=""; content+=""; content+=""; @@ -49,7 +50,7 @@ const std::string InsertedFilesPage::GeneratePage(const std::string &method, con st.Step(); } - return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"+StringFunctions::Replace(m_template,"[CONTENT]",content); + return StringFunctions::Replace(m_template,"[CONTENT]",content); } const bool InsertedFilesPage::WillHandleURI(const std::string &uri)