]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_httpd_config.cpp
Merge pull request #495 from SaberUK/master+fix-libcpp
[user/henk/code/inspircd.git] / src / modules / m_httpd_config.cpp
index f79f0c2a4a1f0cb7e4496b7987aaa02806990eeb..cfdaa4290c3bd0e525290c097db4a243b07e20dd 100644 (file)
@@ -1,28 +1,36 @@
-/*       +------------------------------------+
- *       | Inspire Internet Relay Chat Daemon |
- *       +------------------------------------+
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
  *
- *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
+ *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2008 Craig Edwards <craigedwards@brainbox.cc>
  *
- * This program is free but copyrighted software; see
- *         the file COPYING for details.
+ * This file is part of InspIRCd.  InspIRCd is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
  *
- * ---------------------------------------------------
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+
 #include "inspircd.h"
-#include "httpd.h"
+#include "modules/httpd.h"
 #include "protocol.h"
 
-/* $ModDesc: Provides statistics over HTTP via m_httpd.so */
+/* $ModDesc: Allows for the server configuration to be viewed over HTTP via m_httpd.so */
 
 class ModuleHttpConfig : public Module
 {
  public:
-       ModuleHttpConfig()      {
+       void init()
+       {
                Implementation eventlist[] = { I_OnEvent };
-               ServerInstance->Modules->Attach(eventlist, this, 1);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
        std::string Sanitize(const std::string &str)
@@ -65,7 +73,7 @@ class ModuleHttpConfig : public Module
 
                if (event.id == "httpd_url")
                {
-                       ServerInstance->Logs->Log("m_http_stats", DEBUG,"Handling httpd event");
+                       ServerInstance->Logs->Log("m_http_stats", LOG_DEBUG,"Handling httpd event");
                        HTTPRequest* http = (HTTPRequest*)&event;
 
                        if ((http->GetURI() == "/config") || (http->GetURI() == "/config/"))
@@ -94,13 +102,9 @@ class ModuleHttpConfig : public Module
                }
        }
 
-       virtual ~ModuleHttpConfig()
-       {
-       }
-
        virtual Version GetVersion()
        {
-               return Version("Provides configuration over HTTP via m_httpd.so", VF_VENDOR);
+               return Version("Allows for the server configuration to be viewed over HTTP via m_httpd.so", VF_VENDOR);
        }
 };