web: only delete channels, notes, keys and certs on POST

This commit is contained in:
Alhuda Khan committed 2026-10-26 19:15:53 +05:30
1 parent 9962274521
commit 8dc96ae08c
9 files changed
+124 -10

No files matched your search

+16 -3
View File
@@ -568,7 +568,7 @@ class CWebAdminMod : public CModule {
}
if (pNetwork) {
return DelChan(WebSock, pNetwork);
return DelChan(WebSock, pNetwork, Tmpl);
}
WebSock.PrintErrorPage(t_s("No such user or network"));
@@ -1306,8 +1306,11 @@ class CWebAdminMod : public CModule {
return false;
}
bool DelChan(CWebSock& WebSock, CIRCNetwork* pNetwork) {
CString sChan = WebSock.GetParam("name", false);
bool DelChan(CWebSock& WebSock, CIRCNetwork* pNetwork, CTemplate& Tmpl) {
CString sChan = WebSock.GetParam("name");
if (sChan.empty() && !WebSock.IsPost()) {
sChan = WebSock.GetParam("name", false);
}
if (sChan.empty()) {
WebSock.PrintErrorPage(
@@ -1315,6 +1318,16 @@ class CWebAdminMod : public CModule {
return true;
}
if (!WebSock.IsPost()) {
// Show the "Are you sure?" page:
Tmpl.SetFile("del_chan.tmpl");
Tmpl["Username"] = pNetwork->GetUser()->GetUsername();
Tmpl["Network"] = pNetwork->GetName();
Tmpl["Channel"] = sChan;
return true;
}
pNetwork->DelChan(sChan);
pNetwork->PutIRC("PART " + sChan);