X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Fsiteinserter.cpp;h=76bfb958ee5aefb863241836d7ce384df0c595fa;hb=b4f4686250878cdf4fcb2986a2ea6546cba867d1;hp=f943f5618a144e17ea150bf0a2810760e4b10ef3;hpb=107bd97018964d48425306026d06afd038e84db0;p=fms.git diff --git a/src/freenet/siteinserter.cpp b/src/freenet/siteinserter.cpp index f943f56..76bfb95 100644 --- a/src/freenet/siteinserter.cpp +++ b/src/freenet/siteinserter.cpp @@ -1,4 +1,5 @@ #include "../../include/freenet/siteinserter.h" +#include "../../include/global.h" #ifdef XMEM #include @@ -191,8 +192,9 @@ std::string SiteInserter::GenerateTrustList(const std::string &htmltemplate, con date.SetToGMTime(); date.Add(0,0,0,-20); - SQLite3DB::Statement st=m_db->Prepare("SELECT Name,PublicKey,LocalMessageTrust,LocalTrustListTrust,IdentityID,MessageTrustComment,TrustListTrustComment FROM tblIdentity WHERE PublicKey IS NOT NULL AND LastSeen IS NOT NULL AND LastSeen>=? ORDER BY Name COLLATE NOCASE;"); - st.Bind(0,date.Format("%Y-%m-%d %H:%M:%S")); + SQLite3DB::Statement st=m_db->Prepare("SELECT Name,PublicKey,tblIdentityTrust.LocalMessageTrust,tblIdentityTrust.LocalTrustListTrust,tblIdentity.IdentityID,tblIdentityTrust.MessageTrustComment,tblIdentityTrust.TrustListTrustComment FROM tblIdentity LEFT JOIN (SELECT IdentityID,LocalMessageTrust,LocalTrustListTrust,MessageTrustComment,TrustListTrustComment FROM tblIdentityTrust WHERE LocalIdentityID=?) AS 'tblIdentityTrust' ON tblIdentity.IdentityID=tblIdentityTrust.IdentityID WHERE PublicKey IS NOT NULL AND LastSeen IS NOT NULL AND LastSeen>=? ORDER BY Name COLLATE NOCASE;"); + st.Bind(0,localidentityid); + st.Bind(1,date.Format("%Y-%m-%d %H:%M:%S")); st.Step(); content+=""; @@ -209,7 +211,6 @@ std::string SiteInserter::GenerateTrustList(const std::string &htmltemplate, con std::string messagetrust=""; std::string trustlisttrust=""; std::string publickey=""; - std::string keypart=""; std::string uskkey=""; st.ResultText(0,idname); @@ -220,11 +221,6 @@ std::string SiteInserter::GenerateTrustList(const std::string &htmltemplate, con st.ResultText(5,messagetrustcomment); st.ResultText(6,trustlisttrustcomment); - if(publickey.size()>8) - { - keypart=publickey.substr(3,5); - } - if(publickey.find("SSK@")==0) { uskkey=publickey; @@ -234,7 +230,7 @@ std::string SiteInserter::GenerateTrustList(const std::string &htmltemplate, con } content+=""; - content+=""; + content+=""; content+=""; content+=""; content+="";
"+SanitizeOutput(idname+keypart)+"..."+SanitizeOutput(CreateShortIdentityName(idname,publickey))+""+messagetrust+""+SanitizeOutput(messagetrustcomment)+""+trustlisttrust+"