diff options
author | Adam <adam@inspircd.org> | 2010-08-03 21:46:15 -0400 |
---|---|---|
committer | Daniel De Graaf <danieldg@inspircd.org> | 2010-08-03 21:46:15 -0400 |
commit | 6ae79027cf27507f0c637ced1c645facaec8bacb (patch) | |
tree | 54416880476cdbdfdbf1fb1b2c190958cebdf88d /src/modules/m_sslinfo.cpp | |
parent | 6b8f8eb33e0a3926125b7e3b1575599ab9020d44 (diff) |
Fix m_opermodes.so sending modes for unintroduced clients with oper autologin (bug 53)
Diffstat (limited to 'src/modules/m_sslinfo.cpp')
-rw-r--r-- | src/modules/m_sslinfo.cpp | 13 |
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); } } |