summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_sslinfo.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp
index e27161dac..7354b16f7 100644
--- a/src/modules/m_sslinfo.cpp
+++ b/src/modules/m_sslinfo.cpp
@@ -130,8 +130,8 @@ class ModuleSSLInfo : public Module
ServerInstance->Extensions.Register(&cmd.CertExt);
- Implementation eventlist[] = { I_OnWhois, I_OnPreCommand, I_OnSetConnectClass, I_OnUserConnect };
- ServerInstance->Modules->Attach(eventlist, this, 4);
+ Implementation eventlist[] = { I_OnWhois, I_OnPreCommand, I_OnSetConnectClass, I_OnUserConnect, I_OnPostConnect };
+ ServerInstance->Modules->Attach(eventlist, this, 5);
}
Version GetVersion()
@@ -205,14 +205,19 @@ class ModuleSSLInfo : public Module
if (!req.cert)
return;
cmd.CertExt.set(user, req.cert);
- if (req.cert->fingerprint.empty())
+ }
+
+ void OnPostConnect(User* user)
+ {
+ ssl_cert *cert = cmd.CertExt.get(user);
+ if (!cert || cert->fingerprint.empty())
return;
// find an auto-oper block for this user
for(OperIndex::iterator i = ServerInstance->Config->oper_blocks.begin(); i != ServerInstance->Config->oper_blocks.end(); i++)
{
OperInfo* ifo = i->second;
std::string fp = ifo->oper_block->getString("fingerprint");
- if (fp == req.cert->fingerprint && ifo->oper_block->getBool("autologin"))
+ if (fp == cert->fingerprint && ifo->oper_block->getBool("autologin"))
user->Oper(ifo);
}
}