version 0.3.0
[fms.git] / src / http / pages / peertrustpage.cpp
index 0ab34f1..92f804c 100644 (file)
@@ -295,8 +295,8 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s
        content+="</tr>\r\n";\r
        \r
        // get count of identities we are showing\r
-       sql="SELECT COUNT(*) FROM tblIdentity LEFT JOIN (SELECT IdentityID FROM tblIdentityTrust WHERE LocalIdentityID=?) AS 'tblIdentityTrust' ON tblIdentity.IdentityID=tblIdentityTrust.IdentityID ";\r
-       sql+="WHERE tblIdentity.Hidden='false'";\r
+       sql="SELECT COUNT(*) FROM tblIdentity LEFT JOIN tblIdentityTrust ON tblIdentity.IdentityID=tblIdentityTrust.IdentityID ";\r
+       sql+="WHERE tblIdentity.Hidden='false' AND tblIdentityTrust.LocalIdentityID=?";\r
        if(namesearch!="")\r
        {\r
                sql+=" AND (Name LIKE '%' || ? || '%' OR PublicKey LIKE '%' || ? || '%')";\r
@@ -314,8 +314,8 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s
        st.Finalize();\r
 \r
        sql="SELECT tblIdentity.IdentityID,Name,tblIdentityTrust.LocalMessageTrust,PeerMessageTrust,tblIdentityTrust.LocalTrustListTrust,PeerTrustListTrust,PublicKey,tblIdentityTrust.MessageTrustComment,tblIdentityTrust.TrustListTrustComment,COUNT(MessageID) AS 'MessageCount',tblIdentity.PublishTrustList ";\r
-       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 ";\r
-       sql+="WHERE tblIdentity.Hidden='false'";\r
+       sql+="FROM tblIdentity LEFT JOIN tblIdentityTrust ON tblIdentity.IdentityID=tblIdentityTrust.IdentityID LEFT JOIN tblMessage ON tblIdentity.IdentityID=tblMessage.IdentityID ";\r
+       sql+="WHERE tblIdentity.Hidden='false' AND tblIdentityTrust.LocalIdentityID=?";\r
        if(namesearch!="")\r
        {\r
                sql+=" AND (Name LIKE  '%' || ? || '%' OR PublicKey LIKE '%' || ? || '%')";\r
@@ -443,7 +443,7 @@ const std::string PeerTrustPage::GeneratePage(const std::string &method, const s
        content+="</table>";\r
        content+="</form>";\r
 \r
-       return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"+StringFunctions::Replace(m_template,"[CONTENT]",content);\r
+       return StringFunctions::Replace(m_template,"[CONTENT]",content);\r
 }\r
 \r
 const std::string PeerTrustPage::GetClassString(const std::string &trustlevel)\r