summaryrefslogtreecommitdiff
path: root/src/modules/m_samode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_samode.cpp')
-rw-r--r--src/modules/m_samode.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp
index 9b71992a6..b24becb97 100644
--- a/src/modules/m_samode.cpp
+++ b/src/modules/m_samode.cpp
@@ -39,6 +39,12 @@ class CommandSamode : public Command
CmdResult Handle (const std::vector<std::string>& parameters, User *user)
{
+ User* target = ServerInstance->FindNick(parameters[0]);
+ if ((target) && (target != user))
+ {
+ if (!user->HasPrivPermission("users/samode-usermodes", true))
+ return CMD_FAILURE;
+ }
this->active = true;
ServerInstance->Parser->CallHandler("MODE", parameters, user);
if (ServerInstance->Modes->GetLastParse().length())
@@ -57,22 +63,18 @@ class ModuleSaMode : public Module
{
}
- void init()
+ void init() CXX11_OVERRIDE
{
ServerInstance->Modules->AddService(cmd);
ServerInstance->Modules->Attach(I_OnPreMode, this);
}
- ~ModuleSaMode()
- {
- }
-
- Version GetVersion()
+ Version GetVersion() CXX11_OVERRIDE
{
return Version("Provides command SAMODE to allow opers to change modes on channels and users", VF_VENDOR);
}
- ModResult OnPreMode(User* source,User* dest,Channel* channel, const std::vector<std::string>& parameters)
+ ModResult OnPreMode(User* source,User* dest,Channel* channel, const std::vector<std::string>& parameters) CXX11_OVERRIDE
{
if (cmd.active)
return MOD_RES_ALLOW;