]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_sslinfo.cpp
Change this to use our md5 provider rather than MD5() in the query
[user/henk/code/inspircd.git] / src / modules / extra / m_sslinfo.cpp
index 5a001ce9ef5003250887d49ee20b1c919979308c..7dc4bd6f311fab3e62b6eacdc9a3984f21763652 100644 (file)
@@ -2,31 +2,29 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *               <Craig@chatspike.net>
- *     
- * Written by Craig Edwards, Craig McLure, and others.
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
  *
  * ---------------------------------------------------
  */
 
-using namespace std;
-
 #include <stdio.h>
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-#include "ssl_cert.h"
+#include "transport.h"
 #include "wildcard.h"
 #include "inspircd.h"
 #include "dns.h"
 
 /* $ModDesc: Provides /sslinfo command used to test who a mask matches */
-        
+/* $ModDep: transport.h */
+
+/** Handle /SSLINFO
+ */
 class cmd_sslinfo : public command_t
 {
  public:
@@ -36,7 +34,7 @@ class cmd_sslinfo : public command_t
                this->syntax = "<nick>";
        }
 
-       void Handle (const char** parameters, int pcnt, userrec *user)
+       CmdResult Handle (const char** parameters, int pcnt, userrec *user)
        {
                userrec* target = ServerInstance->FindNick(parameters[0]);
                ssl_cert* cert;
@@ -52,14 +50,18 @@ class cmd_sslinfo : public command_t
                                user->WriteServ("NOTICE %s :*** Distinguised Name: %s", user->nick, cert->GetDN().c_str());
                                user->WriteServ("NOTICE %s :*** Issuer:            %s", user->nick, cert->GetIssuer().c_str());
                                user->WriteServ("NOTICE %s :*** Key Fingerprint:   %s", user->nick, cert->GetFingerprint().c_str());
+                               return CMD_SUCCESS;
                        }
                        else
                        {
                                user->WriteServ("NOTICE %s :*** No SSL certificate information for this user.", user->nick);
+                               return CMD_FAILURE;
                        }
                }
                else
                        user->WriteServ("401 %s %s :No such nickname", user->nick, parameters[0]);
+
+               return CMD_FAILURE;
        }
 };
 
@@ -85,7 +87,7 @@ class ModuleSSLInfo : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1, 0, 0, 0, VF_VENDOR);
+               return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);
        }
 };