From d1a88f0957aeef918af4cea5dcf87892df755130 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Mon, 1 Apr 2013 01:13:24 +0200 Subject: m_samode Require an oper privilege to change the user modes of other users Issue #417 --- src/modules/m_samode.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index 9b71992a6..a7453c233 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -40,6 +40,12 @@ class CommandSamode : public Command CmdResult Handle (const std::vector& parameters, User *user) { this->active = true; + User* target = ServerInstance->FindNick(parameters[0]); + if ((target) && (target != user)) + { + if (!user->HasPrivPermission("users/samode-usermodes", true)) + return CMD_FAILURE; + } ServerInstance->Parser->CallHandler("MODE", parameters, user); if (ServerInstance->Modes->GetLastParse().length()) ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SAMODE: " +ServerInstance->Modes->GetLastParse()); -- cgit v1.2.3