X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Flocalidentitiespage.cpp;h=f3a4967203015e480c48a5a521ccdd5c21e93ff3;hb=6836fbb5db8464f56e682989996b2210b14231d0;hp=8b26238ff2e436ba7ac4c002ac674e51bf8dbd7c;hpb=b4f4686250878cdf4fcb2986a2ea6546cba867d1;p=fms.git diff --git a/src/http/pages/localidentitiespage.cpp b/src/http/pages/localidentitiespage.cpp index 8b26238..f3a4967 100644 --- a/src/http/pages/localidentitiespage.cpp +++ b/src/http/pages/localidentitiespage.cpp @@ -7,28 +7,6 @@ #include #endif -const std::string LocalIdentitiesPage::CreateTrueFalseDropDown(const std::string &name, const std::string &selected) -{ - std::string rval=""; - - rval+=""; - content+=""; + content+="
NameSingle UsePublish Trust ListPublish Board ListPublish FreesiteAnnounced? *
"; - SQLite3DB::Statement st=m_db->Prepare("SELECT LocalIdentityID,tblLocalIdentity.Name,tblLocalIdentity.PublicKey,tbLLocalIdentity.PublishTrustList,tblLocalIdentity.SingleUse,tblLocalIdentity.PublishBoardList,tblIdentity.IdentityID,tblLocalIdentity.PublishFreesite FROM tblLocalIdentity LEFT JOIN tblIdentity ON tblLocalIdentity.PublicKey=tblIdentity.PublicKey ORDER BY tblLocalIdentity.Name;"); + SQLite3DB::Statement st=m_db->Prepare("SELECT LocalIdentityID,tblLocalIdentity.Name,tblLocalIdentity.PublicKey,tbLLocalIdentity.PublishTrustList,tblLocalIdentity.SingleUse,tblLocalIdentity.PublishBoardList,tblIdentity.IdentityID,tblLocalIdentity.PublishFreesite,tblLocalIdentity.MinMessageDelay,tblLocalIdentity.MaxMessageDelay FROM tblLocalIdentity LEFT JOIN tblIdentity ON tblLocalIdentity.PublicKey=tblIdentity.PublicKey ORDER BY tblLocalIdentity.Name;"); st.Step(); SQLite3DB::Statement trustst=m_db->Prepare("SELECT COUNT(*) FROM tblPeerTrust LEFT JOIN tblIdentity ON tblPeerTrust.TargetIdentityID=tblIdentity.IdentityID WHERE tblIdentity.PublicKey=? GROUP BY tblPeerTrust.TargetIdentityID;"); @@ -224,6 +212,8 @@ const std::string LocalIdentitiesPage::GeneratePage(const std::string &method, c std::string singleuse=""; std::string publishboardlist=""; std::string publishfreesite=""; + std::string minmessagedelay="0"; + std::string maxmessagedelay="0"; st.ResultText(0,id); st.ResultText(1,name); @@ -232,6 +222,8 @@ const std::string LocalIdentitiesPage::GeneratePage(const std::string &method, c st.ResultText(4,singleuse); st.ResultText(5,publishboardlist); st.ResultText(7,publishfreesite); + st.ResultText(8,minmessagedelay); + st.ResultText(9,maxmessagedelay); content+=""; // content+=""; @@ -240,6 +232,8 @@ const std::string LocalIdentitiesPage::GeneratePage(const std::string &method, c content+=""; content+=""; content+=""; + content+=""; + content+=""; trustst.Bind(0,publickey); trustst.Step(); @@ -269,6 +263,7 @@ const std::string LocalIdentitiesPage::GeneratePage(const std::string &method, c content+=""; content+=""; content+=""; + content+=""; st.Step(); count++; } @@ -277,6 +272,7 @@ const std::string LocalIdentitiesPage::GeneratePage(const std::string &method, c content+="
NameSingle UsePublish Trust ListPublish Board ListPublish FreesiteMin Message DelayMax Message DelayAnnounced? *
"+CreateTrueFalseDropDown("publishtrustlist["+countstr+"]",publishtrustlist)+""+CreateTrueFalseDropDown("publishboardlist["+countstr+"]",publishboardlist)+""+CreateTrueFalseDropDown("publishfreesite["+countstr+"]",publishfreesite)+"
"+publickey+"
"; content+="

* An identity is considered successfully announced when you have downloaded a trust list from someone that contains the identity. The number in parenthesis is how many trust lists that identity appears in.

"; content+="

Single Use Identities will automatically be deleted 7 days after creation.

"; + content+="

Messages that each identity sends may be delayed by a random number of minutes between min and max. Set both to 0 to send messages as soon as possible.

"; return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"+StringFunctions::Replace(m_template,"[CONTENT]",content); }