mirror of
https://github.com/anope/anope.git
synced 2026-06-26 03:06:38 +02:00
5f72d1fda5
commit317ead6b39Author: MatthewM <mcm@they-got.us> Date: Tue Dec 11 02:14:06 2012 -0500 Added the HostServ link to the navigation bar commit6b15d7fc5eAuthor: MatthewM <mcm@they-got.us> Date: Tue Dec 11 01:58:18 2012 -0500 Correct some slight over sights that was missed eariler commitb356a46789Author: MatthewM <mcm@they-got.us> Date: Mon Dec 10 23:44:51 2012 -0500 Started work on adding HostServ to the web panel
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
/*
|
|
* (C) 2003-2012 Anope Team
|
|
* Contact us at team@anope.org
|
|
*
|
|
* Please read COPYING and README for further details.
|
|
*/
|
|
|
|
#include "../../webcpanel.h"
|
|
|
|
WebCPanel::HostServ::Request::Request(const Anope::string &cat, const Anope::string &u) : WebPanelProtectedPage (cat, u)
|
|
{
|
|
}
|
|
|
|
bool WebCPanel::HostServ::Request::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply, NickAlias *na, TemplateFileServer::Replacements &replacements)
|
|
{
|
|
if (message.post_data.count("req") > 0)
|
|
{
|
|
std::vector<Anope::string> params;
|
|
std::stringstream cmdstr;
|
|
|
|
cmdstr << HTTPUtils::URLDecode(message.post_data["req"]);
|
|
params.push_back(cmdstr.str());
|
|
WebPanel::RunCommand(na->nc->display, na->nc, Config->HostServ, "hostserv/request", params, replacements);
|
|
}
|
|
|
|
if (na->HasVhost())
|
|
{
|
|
if (na->GetVhostIdent().empty() == false)
|
|
replacements["VHOST"] = na->GetVhostIdent() + "@" + na->GetVhostHost();
|
|
else
|
|
replacements["VHOST"] = na->GetVhostHost();
|
|
}
|
|
TemplateFileServer page("hostserv/request.html");
|
|
page.Serve(server, page_name, client, message, reply, replacements);
|
|
return true;
|
|
}
|