X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Fexecquerypage.cpp;h=358f34ab4f52421cd58290b1cbb0b158e68573c4;hb=fcb124f8d6d3f5678e82049fb8e5e23c8cfaec6d;hp=50d3f0ce56aff09133080903879a377241e66b0c;hpb=befd91205eff729a182f66de15374a577a8718f7;p=fms.git diff --git a/src/http/pages/execquerypage.cpp b/src/http/pages/execquerypage.cpp index 50d3f0c..358f34a 100644 --- a/src/http/pages/execquerypage.cpp +++ b/src/http/pages/execquerypage.cpp @@ -8,10 +8,12 @@ const std::string ExecQueryPage::GeneratePage(const std::string &method, const std::map &queryvars) { std::string content=""; + std::string query=""; - if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="execute" && queryvars.find("query")!=queryvars.end() && (*queryvars.find("query")).second!="") + if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="execute" && queryvars.find("query")!=queryvars.end() && (*queryvars.find("query")).second!="" && ValidateFormPassword(queryvars)) { - SQLite3DB::Recordset rs=m_db->Query((*queryvars.find("query")).second); + query=(*queryvars.find("query")).second; + SQLite3DB::Recordset rs=m_db->Query(query); content+=""; if(rs.Count()>0) @@ -48,12 +50,13 @@ const std::string ExecQueryPage::GeneratePage(const std::string &method, const s content+="

Execute Query

"; content+=""; + content+=CreateFormPassword(); content+=""; - content+=""; + content+=""; content+=""; content+=""; - 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 ExecQueryPage::WillHandleURI(const std::string &uri)