summaryrefslogtreecommitdiff
path: root/modules/webcpanel/pages/chanserv/modes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/webcpanel/pages/chanserv/modes.cpp')
-rw-r--r--modules/webcpanel/pages/chanserv/modes.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/modules/webcpanel/pages/chanserv/modes.cpp b/modules/webcpanel/pages/chanserv/modes.cpp
index 8e77c0287..da7ad0803 100644
--- a/modules/webcpanel/pages/chanserv/modes.cpp
+++ b/modules/webcpanel/pages/chanserv/modes.cpp
@@ -1,8 +1,20 @@
/*
- * (C) 2003-2016 Anope Team
- * Contact us at team@anope.org
+ * Anope IRC Services
*
- * Please read COPYING and README for further details.
+ * Copyright (C) 2012-2016 Anope Team <team@anope.org>
+ *
+ * This file is part of Anope. Anope is free software; you can
+ * redistribute it and/or modify it under the terms of the GNU
+ * General Public License as published by the Free Software
+ * Foundation, version 2.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see see <http://www.gnu.org/licenses/>.
*/
#include "../../webcpanel.h"
@@ -12,7 +24,7 @@ WebCPanel::ChanServ::Modes::Modes(const Anope::string &cat, const Anope::string
{
}
-bool WebCPanel::ChanServ::Modes::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply, NickAlias *na, TemplateFileServer::Replacements &replacements)
+bool WebCPanel::ChanServ::Modes::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply, ::NickServ::Nick *na, TemplateFileServer::Replacements &replacements)
{
const Anope::string &chname = message.get_data["channel"];
const Anope::string &mode = message.get_data["m"];
@@ -27,7 +39,7 @@ bool WebCPanel::ChanServ::Modes::OnRequest(HTTPProvider *server, const Anope::st
}
replacements["ESCAPED_CHANNEL"] = HTTPUtils::URLEncode(chname);
- ChannelInfo *ci = ChannelInfo::Find(chname);
+ ::ChanServ::Channel *ci = ::ChanServ::Find(chname);
if (!ci)
{
@@ -39,13 +51,13 @@ bool WebCPanel::ChanServ::Modes::OnRequest(HTTPProvider *server, const Anope::st
if (!c)
{
- replacements["MESSAGES"] = Anope::printf(CHAN_X_NOT_IN_USE, chname.c_str());
+ replacements["MESSAGES"] = Anope::printf(_("Channel \002%s\002 doesn't exist."), chname.c_str());
Page.Serve(server, page_name, client, message, reply, replacements);
return true;
}
- AccessGroup u_access = ci->AccessFor(na->nc);
- bool has_priv = na->nc->IsServicesOper() && na->nc->o->ot->HasPriv("chanserv/administration");
+ ::ChanServ::AccessGroup u_access = ci->AccessFor(na->GetAccount());
+ bool has_priv = na->GetAccount()->IsServicesOper() && na->GetAccount()->o->GetType()->HasPriv("chanserv/administration");
if (!u_access.HasPriv("MODE") && !has_priv)
{
@@ -78,20 +90,20 @@ bool WebCPanel::ChanServ::Modes::OnRequest(HTTPProvider *server, const Anope::st
if (message.get_data["del"].empty() == false && message.get_data["mask"].empty() == false)
{
std::vector<Anope::string> params;
- params.push_back(ci->name);
+ params.push_back(ci->GetName());
params.push_back("SET");
params.push_back("-" + Anope::string(cm->mchar));
params.push_back(message.get_data["mask"]);
- WebPanel::RunCommand(na->nc->display, na->nc, "ChanServ", "chanserv/mode", params, replacements);
+ WebPanel::RunCommand(na->GetAccount()->GetDisplay(), na->GetAccount(), "ChanServ", "chanserv/mode", params, replacements);
}
else if (message.post_data["mask"].empty() == false)
{
std::vector<Anope::string> params;
- params.push_back(ci->name);
+ params.push_back(ci->GetName());
params.push_back("SET");
params.push_back("+" + Anope::string(cm->mchar));
params.push_back(message.post_data["mask"]);
- WebPanel::RunCommand(na->nc->display, na->nc, "ChanServ", "chanserv/mode", params, replacements);
+ WebPanel::RunCommand(na->GetAccount()->GetDisplay(), na->GetAccount(), "ChanServ", "chanserv/mode", params, replacements);
}
std::vector<Anope::string> v = c->GetModeList(cm->name);