X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Fforumcreatepostpage.cpp;h=c89e1ac050dc5d9bc2356b1c6b2f8efbde60a6db;hb=e662ea47fba8715474851ceebacba400984ee433;hp=18961439711b8267ced6b0e707577d1825bbf32b;hpb=f2545574af789b63fc655decfe31a3d9f1b30504;p=fms.git diff --git a/src/http/pages/forumcreatepostpage.cpp b/src/http/pages/forumcreatepostpage.cpp index 1896143..c89e1ac 100644 --- a/src/http/pages/forumcreatepostpage.cpp +++ b/src/http/pages/forumcreatepostpage.cpp @@ -1,6 +1,7 @@ #include "../../../include/http/pages/forumcreatepostpage.h" #include "../../../include/stringfunctions.h" #include "../../../include/message.h" +#include "../../../include/unicode/unicodeformatter.h" #ifdef XMEM #include @@ -37,7 +38,7 @@ const std::string ForumCreatePostPage::GeneratePage(const std::string &method, c replytomessageidstr=(*queryvars.find("replytomessageid")).second; } - if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="send") + if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="send" && ValidateFormPassword(queryvars)) { if(queryvars.find("localidentityid")!=queryvars.end() && (*queryvars.find("localidentityid")).second!="") { @@ -61,6 +62,7 @@ const std::string ForumCreatePostPage::GeneratePage(const std::string &method, c { body=(*queryvars.find("body")).second; body=StringFunctions::Replace(body,"\r\n","\n"); + UnicodeFormatter::LineWrap(body,80,">",body); } else { @@ -110,13 +112,15 @@ const std::string ForumCreatePostPage::GeneratePage(const std::string &method, c { if(replytomessageidstr!="") { - SQLite3DB::Statement replyst=m_db->Prepare("SELECT Subject, Body FROM tblMessage WHERE MessageID=?;"); + std::string fromname=""; + SQLite3DB::Statement replyst=m_db->Prepare("SELECT Subject, Body, FromName FROM tblMessage WHERE MessageID=?;"); replyst.Bind(0,replytomessageidstr); replyst.Step(); if(replyst.RowReturned()) { replyst.ResultText(0,subject); replyst.ResultText(1,body); + replyst.ResultText(2,fromname); if(subject.size()<3 || (subject.substr(0,3)!="re:" && subject.substr(0,3)!="Re:")) { @@ -148,6 +152,8 @@ const std::string ForumCreatePostPage::GeneratePage(const std::string &method, c } body+="\n"; } + body=fromname+" wrote:\n"+body; + } } } @@ -181,6 +187,7 @@ const std::string ForumCreatePostPage::GeneratePage(const std::string &method, c content+=""; content+=""; content+=""; + content+=CreateFormPassword(); content+=""; content+=""; content+="";
From"+LocalIdentityDropDown("localidentityid",localidentityidstr)+"
Subject