From 3c6e24665f52e3a38adfe4ab6a9adcbbb4926ca2 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 11 Dec 2022 09:58:27 +0000 Subject: Move from m_sslinfo to core_oper and rework. - Promote autologin to a core concept with visibility in events. - Replace the binary yes/no value with strict/relaxed/never. This intentionally breaks v3 oper block autologin as admins will need to review them for the security implications of the new behaviour. --- src/modules/m_account.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/modules/m_account.cpp') diff --git a/src/modules/m_account.cpp b/src/modules/m_account.cpp index d9251f04f..6d408ba39 100644 --- a/src/modules/m_account.cpp +++ b/src/modules/m_account.cpp @@ -338,7 +338,7 @@ public: return MOD_RES_PASSTHRU; } - ModResult OnPreOperLogin(LocalUser* user, const std::shared_ptr& oper) override + ModResult OnPreOperLogin(LocalUser* user, const std::shared_ptr& oper, bool automatic) override { const std::string accountstr = oper->GetConfig()->getString("account"); if (accountstr.empty()) @@ -357,8 +357,11 @@ public: return MOD_RES_PASSTHRU; // Matches on account name. } - ServerInstance->SNO.WriteGlobalSno('o', "%s (%s) [%s] failed to log into the \x02%s\x02 oper account because they are not logged into the correct user account.", - user->nick.c_str(), user->MakeHost().c_str(), user->GetIPString().c_str(), oper->GetName().c_str()); + if (!automatic) + { + ServerInstance->SNO.WriteGlobalSno('o', "%s (%s) [%s] failed to log into the \x02%s\x02 oper account because they are not logged into the correct user account.", + user->nick.c_str(), user->MakeHost().c_str(), user->GetIPString().c_str(), oper->GetName().c_str()); + } return MOD_RES_DENY; // Account required but it does not match. } -- cgit v1.3.1-10-gc9f91