#include "../../../include/http/pages/announceidentitypage.h"\r
#include "../../../include/stringfunctions.h"\r
-#include "../../../include/datetime.h"\r
#include "../../../include/global.h"\r
\r
+#include <Poco/DateTime.h>\r
+#include <Poco/DateTimeFormatter.h>\r
+\r
#ifdef XMEM\r
#include <xmem.h>\r
#endif\r
\r
const std::string AnnounceIdentityPage::GeneratePage(const std::string &method, const std::map<std::string,std::string> &queryvars)\r
{\r
- DateTime date;\r
+ Poco::DateTime date;\r
std::string content;\r
int shown=0;\r
std::string countstr="";\r
content+="<tr><td colspan=\"4\"><center>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.</td></tr>";\r
content+="<tr>";\r
\r
-\r
- date.SetToGMTime();\r
- date.Add(0,0,0,-1);\r
- 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;");\r
+ date-=Poco::Timespan(1,0,0,0,0);\r
+ 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;");\r
st.Step();\r
\r
if(st.RowReturned()==false)\r
content+="</table>";\r
content+="</form>";\r
\r
- return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"+StringFunctions::Replace(m_template,"[CONTENT]",content);\r
+ return StringFunctions::Replace(m_template,"[CONTENT]",content);\r
}\r
\r
const bool AnnounceIdentityPage::WillHandleURI(const std::string &uri)\r