Anope IRC Services  Version 2.0
access.cpp
Go to the documentation of this file.
1 /*
2  * (C) 2003-2014 Anope Team
3  * Contact us at team@anope.org
4  *
5  * Please read COPYING and README for further details.
6  */
7 
8 #include "../../webcpanel.h"
9 
11 {
12 }
13 
15 {
16  if (message.post_data.count("access") > 0)
17  {
18  std::vector<Anope::string> params;
19  params.push_back("ADD");
20  params.push_back(message.post_data["access"]);
21 
22  WebPanel::RunCommand(na->nc->display, na->nc, "NickServ", "nickserv/access", params, replacements);
23  }
24  else if (message.get_data.count("del") > 0 && message.get_data.count("mask") > 0)
25  {
26  std::vector<Anope::string> params;
27  params.push_back("DEL");
28  params.push_back(message.get_data["mask"]);
29 
30  WebPanel::RunCommand(na->nc->display, na->nc, "NickServ", "nickserv/access", params, replacements);
31  }
32 
33  for (unsigned i = 0; i < na->nc->access.size(); ++i)
34  replacements["ACCESS"] = na->nc->access[i];
35 
36  TemplateFileServer page("nickserv/access.html");
37  page.Serve(server, page_name, client, message, reply, replacements);
38  return true;
39 }
40 
Serialize::Reference< NickCore > nc
Definition: account.h:47
bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override
Definition: access.cpp:14
void Serve(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, Replacements &)
Access(const Anope::string &cat, const Anope::string &u)
Definition: access.cpp:10
void RunCommand(const Anope::string &user, NickCore *nc, const Anope::string &service, const Anope::string &c, const std::vector< Anope::string > &params, TemplateFileServer::Replacements &r, const Anope::string &key)
Definition: webcpanel.cpp:234
std::map< Anope::string, Anope::string > post_data
Definition: httpd.h:81
std::map< Anope::string, Anope::string > get_data
Definition: httpd.h:80