mirror of
https://github.com/znc/znc.git
synced 2026-08-08 01:43:03 +02:00
Enable editing trusted fingerprints in webadmin
This commit is contained in:
@@ -80,6 +80,14 @@
|
||||
<br /><span class="info">One server per line, "host [[+]port] [password]", + means SSL</span>
|
||||
</div>
|
||||
|
||||
<div class="subsection twothird">
|
||||
<div class="inputlabel">Trusted SSL fingerprints of this IRC network:</div>
|
||||
<div><textarea name="fingerprints" cols="50" rows="5"><? LOOP TrustedFingerprints ?><? VAR FP ?>
|
||||
<? ENDLOOP ?>
|
||||
</textarea></div>
|
||||
<br /><span class="info">When these certificates are encountered, checks for hostname, expiration date, CA are skipped</span>
|
||||
</div>
|
||||
|
||||
<div class="subsection">
|
||||
<div class="inputlabel">Flood protection:</div>
|
||||
<div class="checkbox">
|
||||
|
||||
@@ -871,6 +871,10 @@ public:
|
||||
l["InConfig"] = "true";
|
||||
}
|
||||
}
|
||||
for (const CString& sFP : pNetwork->GetTrustedFingerprints()) {
|
||||
CTemplate& l = Tmpl.AddRow("TrustedFingerprints");
|
||||
l["FP"] = sFP;
|
||||
}
|
||||
} else {
|
||||
if (!spSession->IsAdmin() && !pUser->HasSpaceForNewNetwork()) {
|
||||
WebSock.PrintErrorPage("Network number limit reached. Ask an admin to increase the limit for you, or delete unneeded networks from Your Settings.");
|
||||
@@ -1018,6 +1022,14 @@ public:
|
||||
pNetwork->AddServer(vsArgs[a].Trim_n());
|
||||
}
|
||||
|
||||
WebSock.GetRawParam("fingerprints").Split("\n", vsArgs);
|
||||
while (!pNetwork->GetTrustedFingerprints().empty()) {
|
||||
pNetwork->DelTrustedFingerprint(*pNetwork->GetTrustedFingerprints().begin());
|
||||
}
|
||||
for (const CString& sFP : vsArgs) {
|
||||
pNetwork->AddTrustedFingerprint(sFP);
|
||||
}
|
||||
|
||||
WebSock.GetParamValues("channel", vsArgs);
|
||||
for (unsigned int a = 0; a < vsArgs.size(); a++) {
|
||||
const CString& sChan = vsArgs[a];
|
||||
|
||||
Reference in New Issue
Block a user