anope

- supernets anope source code & configuration
git clone git://git.acid.vegas/anope.git
Log | Files | Refs | Archive | README

logout.cpp (707B)

      1 /*
      2  * (C) 2003-2022 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 
     10 WebCPanel::Logout::Logout(const Anope::string &u) : WebPanelProtectedPage("", u)
     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 }