std::vector<std::string> publishtrustlist;\r
std::vector<std::string> publishboardlist;\r
std::vector<std::string> publishfreesite;\r
+ std::vector<std::string> mindelay;\r
+ std::vector<std::string> maxdelay;\r
\r
CreateArgArray(queryvars,"chkidentityid",ids);\r
CreateArgArray(queryvars,"singleuse",singleuse);\r
CreateArgArray(queryvars,"publishtrustlist",publishtrustlist);\r
CreateArgArray(queryvars,"publishboardlist",publishboardlist);\r
CreateArgArray(queryvars,"publishfreesite",publishfreesite);\r
+ CreateArgArray(queryvars,"mindelay",mindelay);\r
+ CreateArgArray(queryvars,"maxdelay",maxdelay);\r
\r
if((*queryvars.find("formaction")).second=="update")\r
{\r
- SQLite3DB::Statement update=m_db->Prepare("UPDATE tblLocalIdentity SET SingleUse=?, PublishTrustList=?, PublishBoardList=?, PublishFreesite=? WHERE LocalIdentityID=?;");\r
+ SQLite3DB::Statement update=m_db->Prepare("UPDATE tblLocalIdentity SET SingleUse=?, PublishTrustList=?, PublishBoardList=?, PublishFreesite=?, MinMessageDelay=?, MaxMessageDelay=? WHERE LocalIdentityID=?;");\r
for(int i=0; i<ids.size(); i++)\r
{\r
if(ids[i]!="")\r
{\r
+ int minmessagedelay=0;\r
+ int maxmessagedelay=0;\r
StringFunctions::Convert(ids[i],id);\r
+ StringFunctions::Convert(mindelay[i],minmessagedelay);\r
+ StringFunctions::Convert(maxdelay[i],maxmessagedelay);\r
update.Bind(0,singleuse[i]);\r
update.Bind(1,publishtrustlist[i]);\r
update.Bind(2,publishboardlist[i]);\r
update.Bind(3,publishfreesite[i]);\r
- update.Bind(4,id);\r
+ update.Bind(4,minmessagedelay);\r
+ update.Bind(5,maxmessagedelay);\r
+ update.Bind(6,id);\r
update.Step();\r
update.Reset();\r
}\r
\r
// content+="<form name=\"frmlocalidentity\" method=\"POST\">";\r
// content+="<input type=\"hidden\" name=\"formaction\" value=\"update\">";\r
- content+="<table><tr><th>Name</th><th>Single Use</th><th>Publish Trust List</th><th>Publish Board List</th><th>Publish Freesite</th><th>Announced? *</th></tr>";\r
+ content+="<table><tr><th>Name</th><th>Single Use</th><th>Publish Trust List</th><th>Publish Board List</th><th>Publish Freesite</th><th>Min Message Delay</th><th>Max Message Delay</th><th>Announced? *</th></tr>";\r
\r
- 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;");\r
+ 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;");\r
st.Step();\r
\r
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;");\r
std::string singleuse="";\r
std::string publishboardlist="";\r
std::string publishfreesite="";\r
+ std::string minmessagedelay="0";\r
+ std::string maxmessagedelay="0";\r
\r
st.ResultText(0,id);\r
st.ResultText(1,name);\r
st.ResultText(4,singleuse);\r
st.ResultText(5,publishboardlist);\r
st.ResultText(7,publishfreesite);\r
+ st.ResultText(8,minmessagedelay);\r
+ st.ResultText(9,maxmessagedelay);\r
\r
content+="<tr>";\r
// content+="<td><input type=\"checkbox\" name=\"chkidentityid["+countstr+"]\" value=\""+id+"\"></td>";\r
content+="<td>"+CreateTrueFalseDropDown("publishtrustlist["+countstr+"]",publishtrustlist)+"</td>";\r
content+="<td>"+CreateTrueFalseDropDown("publishboardlist["+countstr+"]",publishboardlist)+"</td>";\r
content+="<td>"+CreateTrueFalseDropDown("publishfreesite["+countstr+"]",publishfreesite)+"</td>";\r
+ content+="<td><input type=\"text\" size=\"2\" name=\"mindelay["+countstr+"]\" value=\""+minmessagedelay+"\"></td>";\r
+ content+="<td><input type=\"text\" size=\"2\" name=\"maxdelay["+countstr+"]\" value=\""+maxmessagedelay+"\"></td>";\r
\r
trustst.Bind(0,publickey);\r
trustst.Step();\r
content+="</table>";\r
content+="<p class=\"paragraph\">* 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.</p>";\r
content+="<p class=\"paragraph\">Single Use Identities will automatically be deleted 7 days after creation.</p>";\r
+ content+="<p class=\"paragraph\">Messages that each identity sends may be delayed by a random number of minutes between min and max. Set both to 0 to send messages as soon as possible.</p>";\r
\r
return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"+StringFunctions::Replace(m_template,"[CONTENT]",content);\r
}\r