Permalink
Browse files

webadmin: Add a "Disabled" checkbox for channels

Signed-off-by: Uli Schlachter <psychon@znc.in>
  • Loading branch information...
1 parent 9140a0d commit a66721eacb74688740a38ce49630f91ce252420d @psychon psychon committed Oct 30, 2011
Showing with 11 additions and 1 deletion.
  1. +11 −1 modules/webadmin.cpp
View
@@ -560,6 +560,11 @@ class CWebAdminMod : public CModule {
o3["DisplayName"] = "Detached";
if (pChan && pChan->IsDetached()) { o3["Checked"] = "true"; }
+ CTemplate& o4 = Tmpl.AddRow("OptionLoop");
+ o4["Name"] = "disabled";
+ o4["DisplayName"] = "Disabled";
+ if (pChan && pChan->IsDisabled()) { o4["Checked"] = "true"; }
+
FOR_EACH_MODULE(i, pUser) {
CTemplate& mod = Tmpl.AddRow("EmbeddedModuleLoop");
mod.insert(Tmpl.begin(), Tmpl.end());
@@ -597,7 +602,6 @@ class CWebAdminMod : public CModule {
pChan->SetKey(WebSock.GetParam("key"));
bool bDetached = WebSock.GetParam("detached").ToBool();
-
if (pChan->IsDetached() != bDetached) {
if (bDetached) {
pChan->DetachUser();
@@ -606,6 +610,12 @@ class CWebAdminMod : public CModule {
}
}
+ bool bDisabled = WebSock.GetParam("disabled").ToBool();
+ if (bDisabled)
+ pChan->Disable();
+ else
+ pChan->Enable();
+
CTemplate TmplMod;
TmplMod["User"] = pUser->GetUserName();
TmplMod["ChanName"] = sChanName;

0 comments on commit a66721e

Please sign in to comment.