summaryrefslogtreecommitdiff
path: root/modules/extra/webcpanel/pages/chanserv/info.cpp
diff options
context:
space:
mode:
authorDukePyrolator <DukePyrolator@anope.org>2013-09-03 04:37:09 +0200
committerDukePyrolator <DukePyrolator@anope.org>2013-09-03 04:37:09 +0200
commit404debf78925f86e94cfd71334433bc1eb423115 (patch)
tree6388a371c610d67dbee46bd7a898bb18359765e8 /modules/extra/webcpanel/pages/chanserv/info.cpp
parent752a5ca1b7d89044728a045622b3f3db5fb94f7e (diff)
updated the chanserv section in webcpanel
Diffstat (limited to 'modules/extra/webcpanel/pages/chanserv/info.cpp')
-rw-r--r--modules/extra/webcpanel/pages/chanserv/info.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/modules/extra/webcpanel/pages/chanserv/info.cpp b/modules/extra/webcpanel/pages/chanserv/info.cpp
index 95592706d..5338cc4b2 100644
--- a/modules/extra/webcpanel/pages/chanserv/info.cpp
+++ b/modules/extra/webcpanel/pages/chanserv/info.cpp
@@ -6,6 +6,7 @@
*/
#include "../../webcpanel.h"
+#include "utils.h"
WebCPanel::ChanServ::Info::Info(const Anope::string &cat, const Anope::string &u) : WebPanelProtectedPage(cat, u)
{
@@ -13,21 +14,13 @@ WebCPanel::ChanServ::Info::Info(const Anope::string &cat, const Anope::string &u
bool WebCPanel::ChanServ::Info::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply, NickAlias *na, TemplateFileServer::Replacements &replacements)
{
- std::deque<ChannelInfo *> queue;
- na->nc->GetChannelReferences(queue);
- for (unsigned i = 0; i < queue.size(); ++i)
- {
- ChannelInfo *ci = queue[i];
+ const Anope::string &chname = message.get_data["channel"];
- if (ci->AccessFor(na->nc).HasPriv("SET") || ci->AccessFor(na->nc).HasPriv("ACCESS_LIST"))
- {
- replacements["CHANNEL_NAMES"] = ci->name;
- replacements["ESCAPED_CHANNEL_NAMES"] = HTTPUtils::URLEncode(ci->name);
- }
- }
+ if (!chname.empty())
+ replacements["ESCAPED_CHANNEL"] = HTTPUtils::URLEncode(chname);
- TemplateFileServer page("chanserv/main.html");
- page.Serve(server, page_name, client, message, reply, replacements);
- return true;
+ BuildChanlist("/chanserv/set", na, replacements);
+
+ return ServePage("chanserv/main.html", server, page_name, client, message, reply, replacements);
}