X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhttp%2Fpages%2Faddpeerpage.cpp;h=f4e483be82de455e510dad329a4e7635ea831a6b;hb=dec33c63afafabf83c3039e916725cac6faef9b3;hp=d97d5961bb1fa82121cc3d300533d9db2644877f;hpb=9b22dd53fe62e312c1647310b7ec43aa127090af;p=fms.git diff --git a/src/http/pages/addpeerpage.cpp b/src/http/pages/addpeerpage.cpp index d97d596..f4e483b 100644 --- a/src/http/pages/addpeerpage.cpp +++ b/src/http/pages/addpeerpage.cpp @@ -1,6 +1,8 @@ #include "../../../include/http/pages/addpeerpage.h" #include "../../../include/stringfunctions.h" -#include "../../../include/datetime.h" + +#include +#include #ifdef XMEM #include @@ -12,7 +14,7 @@ const std::string AddPeerPage::GeneratePage(const std::string &method, const std if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="add") { - DateTime date; + Poco::DateTime date; std::string publickey=""; if(queryvars.find("publickey")!=queryvars.end()) { @@ -20,10 +22,9 @@ const std::string AddPeerPage::GeneratePage(const std::string &method, const std } if(publickey!="" && publickey.find("SSK@")==0 && publickey[publickey.size()-1]=='/') { - date.SetToGMTime(); SQLite3DB::Statement st=m_db->Prepare("INSERT INTO tblIdentity(PublicKey,DateAdded,AddedMethod) VALUES(?,?,?);"); st.Bind(0,publickey); - st.Bind(1,date.Format("%Y-%m-%d %H:%M:%S")); + st.Bind(1,Poco::DateTimeFormatter::format(date,"%Y-%m-%d %H:%M:%S")); st.Bind(2,"manually"); st.Step(); st.Reset(); @@ -41,7 +42,7 @@ const std::string AddPeerPage::GeneratePage(const std::string &method, const std 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 AddPeerPage::WillHandleURI(const std::string &uri)