X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sslinfo.cpp;h=b51c30b768ab0df72fdae9b89ebe275361de33f2;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=33a36d3b4b9044f3f4e92eed6b53a2fbb553de3f;hpb=cff57f7ba780a5c4fc331ccbab489abdc572379c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index 33a36d3b4..b51c30b76 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -18,7 +18,7 @@ #include "inspircd.h" -#include "ssl.h" +#include "modules/ssl.h" /* $ModDesc: Provides SSL metadata, including /WHOIS information and /SSLINFO command */ @@ -91,13 +91,13 @@ class CommandSSLInfo : public Command { User* target = ServerInstance->FindNickOnly(parameters[0]); - if (!target) + if ((!target) || (target->registered != REG_ALL)) { user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nickname", user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } bool operonlyfp = ServerInstance->Config->ConfValue("sslinfo")->getBool("operonly"); - if (operonlyfp && !IS_OPER(user) && target != user) + if (operonlyfp && !user->IsOper() && target != user) { user->WriteServ("NOTICE %s :*** You cannot view SSL certificate information for other users", user->nick.c_str()); return CMD_FAILURE; @@ -132,12 +132,12 @@ class ModuleSSLInfo : public Module void init() { - ServerInstance->AddCommand(&cmd); + ServerInstance->Modules->AddService(cmd); - ServerInstance->Extensions.Register(&cmd.CertExt); + ServerInstance->Modules->AddService(cmd.CertExt); Implementation eventlist[] = { I_OnWhois, I_OnPreCommand, I_OnSetConnectClass, I_OnUserConnect, I_OnPostConnect }; - ServerInstance->Modules->Attach(eventlist, this, 5); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } Version GetVersion() @@ -152,7 +152,7 @@ class ModuleSSLInfo : public Module { ServerInstance->SendWhoisLine(source, dest, 671, "%s %s :is using a secure connection", source->nick.c_str(), dest->nick.c_str()); bool operonlyfp = ServerInstance->Config->ConfValue("sslinfo")->getBool("operonly"); - if ((!operonlyfp || source == dest || IS_OPER(source)) && !cert->fingerprint.empty()) + if ((!operonlyfp || source == dest || source->IsOper()) && !cert->fingerprint.empty()) ServerInstance->SendWhoisLine(source, dest, 276, "%s %s :has client certificate fingerprint %s", source->nick.c_str(), dest->nick.c_str(), cert->fingerprint.c_str()); } @@ -255,4 +255,3 @@ class ModuleSSLInfo : public Module }; MODULE_INIT(ModuleSSLInfo) -