aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_account.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-12-11 09:58:27 +0000
committerGravatar Sadie Powell2022-12-11 10:14:33 +0000
commit3c6e24665f52e3a38adfe4ab6a9adcbbb4926ca2 (patch)
treeb2b51956059bd7636aeeb81233aff05983c7687e /src/modules/m_account.cpp
parentImprove the oper login flow and error messages. (diff)
Move <oper:autologin> 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.
Diffstat (limited to 'src/modules/m_account.cpp')
-rw-r--r--src/modules/m_account.cpp9
1 files changed, 6 insertions, 3 deletions
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<OperAccount>& oper) override
+ ModResult OnPreOperLogin(LocalUser* user, const std::shared_ptr<OperAccount>& 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.
}