4
mirror of git://git.acid.vegas/anope.git synced 2024-11-16 20:56:42 +00:00
anope/modules/webcpanel/pages/chanserv/info.cpp
2023-05-07 13:44:21 -04:00

28 lines
834 B
C++

/*
* (C) 2003-2022 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#include "../../webcpanel.h"
#include "utils.h"
WebCPanel::ChanServ::Info::Info(const Anope::string &cat, const Anope::string &u) : WebPanelProtectedPage(cat, u)
{
}
bool WebCPanel::ChanServ::Info::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply, NickAlias *na, TemplateFileServer::Replacements &replacements)
{
const Anope::string &chname = message.get_data["channel"];
if (!chname.empty())
replacements["ESCAPED_CHANNEL"] = HTTPUtils::URLEncode(chname);
BuildChanList(na, replacements);
TemplateFileServer page("chanserv/main.html");
page.Serve(server, page_name, client, message, reply, replacements);
return true;
}