Anope IRC Services  Version 2.0
logout.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 
14 bool WebCPanel::Logout::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply, NickAlias *na, TemplateFileServer::Replacements &replacements)
15 {
16  na->Shrink<Anope::string>("webcpanel_id");
17  na->Shrink<Anope::string>("webcpanel_ip");
18 
19  reply.error = HTTP_FOUND;
20  reply.headers["Location"] = Anope::string("http") + (server->IsSSL() ? "s" : "") + "://" + message.headers["Host"] + "/";
21  return true;
22 }
23 
std::map< Anope::string, Anope::string > headers
Definition: httpd.h:78
Logout(const Anope::string &u)
Definition: logout.cpp:10
bool IsSSL() const
Definition: httpd.h:151
void Shrink(const Anope::string &name)
Definition: extensible.h:253
std::map< Anope::string, Anope::string > headers
Definition: httpd.h:18
HTTPError error
Definition: httpd.h:16
std::basic_string< char, ci_char_traits, std::allocator< char > > string
Definition: hashcomp.h:133
bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override
Definition: logout.cpp:14