X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Fpeertrustpage.cpp;h=3fee7ace757741dc23d2f27acfc657d63a9604a0;hb=fcb124f8d6d3f5678e82049fb8e5e23c8cfaec6d;hp=0ab34f1f1924110c1bdd564b27110c42ab0c396f;hpb=18b45335ba24f3b6b6d4f4acfe8c5a5ae845ce00;p=fms.git diff --git a/src/http/pages/peertrustpage.cpp b/src/http/pages/peertrustpage.cpp index 0ab34f1..3fee7ac 100644 --- a/src/http/pages/peertrustpage.cpp +++ b/src/http/pages/peertrustpage.cpp @@ -148,7 +148,7 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s } } - if(localidentityid!=-1 && queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="update") + if(localidentityid!=-1 && queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="update" && ValidateFormPassword(queryvars)) { std::vector identityids; std::vector oldlmt; @@ -276,6 +276,7 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s content+=""; content+="
"; + content+=CreateFormPassword(); content+=""; content+=""; content+=""; @@ -295,8 +296,8 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s content+="\r\n"; // get count of identities we are showing - sql="SELECT COUNT(*) FROM tblIdentity LEFT JOIN (SELECT IdentityID FROM tblIdentityTrust WHERE LocalIdentityID=?) AS 'tblIdentityTrust' ON tblIdentity.IdentityID=tblIdentityTrust.IdentityID "; - sql+="WHERE tblIdentity.Hidden='false'"; + sql="SELECT COUNT(*) FROM tblIdentity LEFT JOIN tblIdentityTrust ON tblIdentity.IdentityID=tblIdentityTrust.IdentityID "; + sql+="WHERE tblIdentity.Hidden='false' AND tblIdentityTrust.LocalIdentityID=?"; if(namesearch!="") { sql+=" AND (Name LIKE '%' || ? || '%' OR PublicKey LIKE '%' || ? || '%')"; @@ -314,8 +315,8 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s st.Finalize(); sql="SELECT tblIdentity.IdentityID,Name,tblIdentityTrust.LocalMessageTrust,PeerMessageTrust,tblIdentityTrust.LocalTrustListTrust,PeerTrustListTrust,PublicKey,tblIdentityTrust.MessageTrustComment,tblIdentityTrust.TrustListTrustComment,COUNT(MessageID) AS 'MessageCount',tblIdentity.PublishTrustList "; - sql+="FROM tblIdentity LEFT JOIN (SELECT LocalIdentityID,IdentityID,LocalMessageTrust,LocalTrustListTrust,MessageTrustComment,TrustListTrustComment FROM tblIdentityTrust WHERE LocalIdentityID=?) AS tblIdentityTrust ON tblIdentity.IdentityID=tblIdentityTrust.IdentityID LEFT JOIN tblMessage ON tblIdentity.IdentityID=tblMessage.IdentityID "; - sql+="WHERE tblIdentity.Hidden='false'"; + sql+="FROM tblIdentity LEFT JOIN tblIdentityTrust ON tblIdentity.IdentityID=tblIdentityTrust.IdentityID LEFT JOIN tblMessage ON tblIdentity.IdentityID=tblMessage.IdentityID "; + sql+="WHERE tblIdentity.Hidden='false' AND tblIdentityTrust.LocalIdentityID=?"; if(namesearch!="") { sql+=" AND (Name LIKE '%' || ? || '%' OR PublicKey LIKE '%' || ? || '%')"; @@ -443,7 +444,7 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s content+=""; content+="
"; - return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"+StringFunctions::Replace(m_template,"[CONTENT]",content); + return StringFunctions::Replace(m_template,"[CONTENT]",content); } const std::string PeerTrustPage::GetClassString(const std::string &trustlevel)