X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Flocalidentitiespage.cpp;h=c0b6105a9fd10ce29d248a09998f9b68899c35a8;hb=107bd97018964d48425306026d06afd038e84db0;hp=f84362e41bcea10547a9aff1a60c8e0a090fecbd;hpb=5c0453c8697cfaa843dd7f799e5404733ee56e13;p=fms.git diff --git a/src/http/pages/localidentitiespage.cpp b/src/http/pages/localidentitiespage.cpp index f84362e..c0b6105 100644 --- a/src/http/pages/localidentitiespage.cpp +++ b/src/http/pages/localidentitiespage.cpp @@ -210,6 +210,8 @@ const std::string LocalIdentitiesPage::GeneratePage(const std::string &method, c 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;"); 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;"); + count=0; while(st.RowReturned()) { @@ -243,6 +245,22 @@ const std::string LocalIdentitiesPage::GeneratePage(const std::string &method, c content+=""+CreateTrueFalseDropDown("publishtrustlist["+countstr+"]",publishtrustlist)+""; content+=""+CreateTrueFalseDropDown("publishboardlist["+countstr+"]",publishboardlist)+""; content+=""+CreateTrueFalseDropDown("publishfreesite["+countstr+"]",publishfreesite)+""; + + trustst.Bind(0,publickey); + trustst.Step(); + if(trustst.RowReturned()) + { + std::string numlists=""; + trustst.ResultText(0,numlists); + content+="Yes ("+numlists+")"; + } + else + { + content+="No"; + } + trustst.Reset(); + +/* if(st.ResultNull(6)) { content+="No"; @@ -251,6 +269,8 @@ const std::string LocalIdentitiesPage::GeneratePage(const std::string &method, c { content+="Yes"; } +*/ + content+=""; content+="
"; content+=""; @@ -260,7 +280,7 @@ const std::string LocalIdentitiesPage::GeneratePage(const std::string &method, c // content+="
"; content+=""; - content+="

* An identity is considered successfully announced when you have downloaded a trust list from someone that contains the identity.

"; + 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.

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