X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Fhttp%2Fpages%2Flocalidentitiespage.cpp;h=400260f6cf0091f2932d266cfc2d0f0abf56602e;hp=d4e0d440dc0867ddea7bb97e7f470b9b26bddf53;hb=dabd19d7f764b8275c9c8370c7b89675b6a78243;hpb=05ef25de71be91442b4cbd22dc7cc45629c5d5bb diff --git a/src/http/pages/localidentitiespage.cpp b/src/http/pages/localidentitiespage.cpp index d4e0d44..400260f 100644 --- a/src/http/pages/localidentitiespage.cpp +++ b/src/http/pages/localidentitiespage.cpp @@ -37,6 +37,7 @@ 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,tblLocalIdentity.MinMessageDelay,tblLocalIdentity.MaxMessageDelay FROM tblLocalIdentity LEFT JOIN tblIdentity ON tblLocalIdentity.PublicKey=tblIdentity.PublicKey ORDER BY tblLocalIdentity.Name;"); st.Step(); + SQLite3DB::Statement st2=m_db->Prepare("SELECT IdentityID FROM tblIdentity WHERE PublicKey=?;"); 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;"); @@ -53,6 +54,7 @@ const std::string LocalIdentitiesPage::GeneratePage(const std::string &method, c std::string publishfreesite=""; std::string minmessagedelay="0"; std::string maxmessagedelay="0"; + std::string identityidstr=""; st.ResultText(0,id); st.ResultText(1,name); @@ -64,8 +66,26 @@ const std::string LocalIdentitiesPage::GeneratePage(const std::string &method, c st.ResultText(8,minmessagedelay); st.ResultText(9,maxmessagedelay); + st2.Bind(0,publickey); + st2.Step(); + if(st2.RowReturned()) + { + st2.ResultText(0,identityidstr); + } + st2.Reset(); + content+=""; - content+="
"+CreateFormPassword()+""+SanitizeOutput(CreateShortIdentityName(name,publickey))+""; + content+=""+CreateFormPassword()+""; + if(identityidstr!="") + { + content+=""; + } + content+=SanitizeOutput(CreateShortIdentityName(name,publickey)); + if(identityidstr!="") + { + content+=""; + } + content+=""; content+=""+CreateTrueFalseDropDown("singleuse["+countstr+"]",singleuse)+""; content+=""+CreateTrueFalseDropDown("publishtrustlist["+countstr+"]",publishtrustlist)+""; content+=""+CreateTrueFalseDropDown("publishboardlist["+countstr+"]",publishboardlist)+"";