X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Fannounceidentitypage.cpp;h=6de18a3cacbeaeea7ab08ef96cc3e10a614fbdbc;hb=cd75427de26fc2ebc9baad558b1c0a081faa3b43;hp=32a13cc0546970081125a06afa5a0a79b5650438;hpb=befd91205eff729a182f66de15374a577a8718f7;p=fms.git diff --git a/src/http/pages/announceidentitypage.cpp b/src/http/pages/announceidentitypage.cpp index 32a13cc..6de18a3 100644 --- a/src/http/pages/announceidentitypage.cpp +++ b/src/http/pages/announceidentitypage.cpp @@ -1,6 +1,9 @@ #include "../../../include/http/pages/announceidentitypage.h" #include "../../../include/stringfunctions.h" -#include "../../../include/datetime.h" +#include "../../../include/global.h" + +#include +#include #ifdef XMEM #include @@ -18,18 +21,12 @@ const std::string AnnounceIdentityPage::CreateLocalIdentityDropDown(const std::s std::string id; std::string name; std::string pubkey; - std::string keypart=""; st.ResultText(0,id); st.ResultText(1,name); st.ResultText(2,pubkey); - if(pubkey.size()>8) - { - keypart=pubkey.substr(3,5); - } - - rval+=""; + rval+=""; st.Step(); } rval+=""; @@ -38,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=""; @@ -92,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) @@ -150,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)