X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Fannounceidentitypage.cpp;h=6de18a3cacbeaeea7ab08ef96cc3e10a614fbdbc;hp=83ce674673d05b17c8fcf6f0c8d404f2bd0d43f0;hb=dec33c63afafabf83c3039e916725cac6faef9b3;hpb=9b22dd53fe62e312c1647310b7ec43aa127090af diff --git a/src/http/pages/announceidentitypage.cpp b/src/http/pages/announceidentitypage.cpp index 83ce674..6de18a3 100644 --- a/src/http/pages/announceidentitypage.cpp +++ b/src/http/pages/announceidentitypage.cpp @@ -1,8 +1,10 @@ #include "../../../include/http/pages/announceidentitypage.h" #include "../../../include/stringfunctions.h" -#include "../../../include/datetime.h" #include "../../../include/global.h" +#include +#include + #ifdef XMEM #include #endif @@ -33,7 +35,7 @@ const std::string AnnounceIdentityPage::CreateLocalIdentityDropDown(const std::s const std::string AnnounceIdentityPage::GeneratePage(const std::string &method, const std::map &queryvars) { - DateTime date; + Poco::DateTime date; std::string content; int shown=0; std::string countstr=""; @@ -87,10 +89,8 @@ const std::string AnnounceIdentityPage::GeneratePage(const std::string &method, content+="
Type the answers of a few puzzles. The puzzles are case sensitive. Getting announced will take some time. DO NOT continuously solve captchas. Solve 30 at most, wait a day, and if your identity has not been announced, repeat until it is."; content+=""; - - date.SetToGMTime(); - date.Add(0,0,0,-1); - SQLite3DB::Statement st=m_db->Prepare("SELECT UUID,Day,IdentityID,RequestIndex FROM tblIntroductionPuzzleRequests WHERE UUID NOT IN (SELECT UUID FROM tblIdentityIntroductionInserts) AND UUID NOT IN (SELECT UUID FROM tblIntroductionPuzzleInserts) AND Day>='"+date.Format("%Y-%m-%d")+"' AND Found='true' ORDER BY IdentityID, Day DESC, RequestIndex DESC;"); + date-=Poco::Timespan(1,0,0,0,0); + SQLite3DB::Statement st=m_db->Prepare("SELECT UUID,Day,IdentityID,RequestIndex FROM tblIntroductionPuzzleRequests WHERE UUID NOT IN (SELECT UUID FROM tblIdentityIntroductionInserts) AND UUID NOT IN (SELECT UUID FROM tblIntroductionPuzzleInserts) AND Day>='"+Poco::DateTimeFormatter::format(date,"%Y-%m-%d")+"' AND Found='true' ORDER BY IdentityID, Day DESC, RequestIndex DESC;"); st.Step(); if(st.RowReturned()==false) @@ -145,7 +145,7 @@ const std::string AnnounceIdentityPage::GeneratePage(const std::string &method, 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 AnnounceIdentityPage::WillHandleURI(const std::string &uri)