inspircd

A modular C++ IRC daemon (ircd). https://www.inspircd.org/
Log | Files | Refs | README

commit 1e60f38babe109dd69a5f668dbb34680f4007b98
parent 806b4d55a2f19b6521c34af6210c323a1beb414b
Author: Peter Powell <petpow@saberuk.com>
Date:   Fri,  7 Jun 2019 01:34:51 +0100

Show how many users are non-SSL in ERR_ALLMUSTSSL.

Diffstat:
Msrc/modules/m_sslmodes.cpp | 13+++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp @@ -61,15 +61,20 @@ class SSLMode : public ModeHandler return MODEACTION_DENY; } + unsigned long nonssl = 0; const Channel::MemberMap& userlist = channel->GetUsers(); for (Channel::MemberMap::const_iterator i = userlist.begin(); i != userlist.end(); ++i) { ssl_cert* cert = API->GetCertificate(i->first); if (!cert && !i->first->server->IsULine()) - { - source->WriteNumeric(ERR_ALLMUSTSSL, channel->name, "all members of the channel must be connected via SSL"); - return MODEACTION_DENY; - } + nonssl++; + } + + if (nonssl) + { + source->WriteNumeric(ERR_ALLMUSTSSL, channel->name, InspIRCd::Format("All members of the channel must be connected via SSL (%lu/%lu are non-SSL)", + nonssl, static_cast<unsigned long>(userlist.size()))); + return MODEACTION_DENY; } } channel->SetMode(this, true);