From 8f5d786f0eaec17dd2cb60f3dfb434caabf48e92 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 9 Oct 2012 05:22:02 -0400 Subject: Cleanup ok if modules with pending identify requests are unloaded --- modules/extra/webcpanel/pages/index.cpp | 4 ++-- modules/extra/webcpanel/webcpanel.cpp | 3 +++ modules/extra/webcpanel/webcpanel.h | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'modules/extra/webcpanel') diff --git a/modules/extra/webcpanel/pages/index.cpp b/modules/extra/webcpanel/pages/index.cpp index 73f7224f4..357d3ec3b 100644 --- a/modules/extra/webcpanel/pages/index.cpp +++ b/modules/extra/webcpanel/pages/index.cpp @@ -17,7 +17,7 @@ class WebpanelRequest : public IdentifyRequest TemplateFileServer::Replacements replacements; public: - WebpanelRequest(HTTPReply &r, HTTPMessage &m, HTTPProvider *s, const Anope::string &p_n, HTTPClient *c, TemplateFileServer::Replacements &re, const Anope::string &user, const Anope::string &pass) : IdentifyRequest(user, pass), reply(r), message(m), server(s), page_name(p_n), client(c), replacements(re) { } + WebpanelRequest(Module *o, HTTPReply &r, HTTPMessage &m, HTTPProvider *s, const Anope::string &p_n, HTTPClient *c, TemplateFileServer::Replacements &re, const Anope::string &user, const Anope::string &pass) : IdentifyRequest(o, user, pass), reply(r), message(m), server(s), page_name(p_n), client(c), replacements(re) { } void OnSuccess() anope_override { @@ -86,7 +86,7 @@ bool WebCPanel::Index::OnRequest(HTTPProvider *server, const Anope::string &page { // Rate limit check. - WebpanelRequest *req = new WebpanelRequest(reply, message, server, page_name, client, replacements, user, pass); + WebpanelRequest *req = new WebpanelRequest(me, reply, message, server, page_name, client, replacements, user, pass); FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(NULL, req)); req->Dispatch(); return false; diff --git a/modules/extra/webcpanel/webcpanel.cpp b/modules/extra/webcpanel/webcpanel.cpp index b6b2d5776..c23b6efbf 100644 --- a/modules/extra/webcpanel/webcpanel.cpp +++ b/modules/extra/webcpanel/webcpanel.cpp @@ -7,6 +7,7 @@ #include "webcpanel.h" +Module *me; Anope::string provider_name, template_name, template_base, page_title; class ModuleWebCPanel : public Module @@ -45,6 +46,8 @@ class ModuleWebCPanel : public Module { this->SetAuthor("Anope"); + me = this; + ConfigReader reader; provider_name = reader.ReadValue("webcpanel", "server", "httpd/main", 0); template_name = reader.ReadValue("webcpanel", "template", "template", 0); diff --git a/modules/extra/webcpanel/webcpanel.h b/modules/extra/webcpanel/webcpanel.h index e33025b52..926feaf53 100644 --- a/modules/extra/webcpanel/webcpanel.h +++ b/modules/extra/webcpanel/webcpanel.h @@ -11,6 +11,8 @@ #include "static_fileserver.h" #include "template_fileserver.h" +extern Module *me; + extern Anope::string provider_name, template_name, template_base, page_title; struct SubSection -- cgit