X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_samode.cpp;h=0dae8cb0ce9ccc3bbef9c9bfc0a9eb34127c6e78;hb=66dbd438f23a6beb06b0d44b9121deeb1e3f73bc;hp=db3345b98920f95f39bd21424c0b5f6ec3a55d48;hpb=4047a143fc1d16350db70c94b9ea77d79de05714;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index db3345b98..0dae8cb0c 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -1,10 +1,14 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2013, 2017-2020 Sadie Powell + * Copyright (C) 2013 Daniel Vassdal + * Copyright (C) 2012-2016, 2018 Attila Molnar + * Copyright (C) 2012, 2019 Robby * Copyright (C) 2009 Daniel De Graaf + * Copyright (C) 2007 Robin Burchell * Copyright (C) 2007 Dennis Friis - * Copyright (C) 2006-2007 Robin Burchell - * Copyright (C) 2004-2005 Craig Edwards + * Copyright (C) 2006, 2010 Craig Edwards * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -33,7 +37,8 @@ class CommandSamode : public Command CommandSamode(Module* Creator) : Command(Creator,"SAMODE", 2) { allow_empty_last_param = false; - flags_needed = 'o'; syntax = " {}"; + flags_needed = 'o'; + syntax = " (+|-) []"; active = false; } @@ -49,8 +54,11 @@ class CommandSamode : public Command } // Changing the modes of another user requires a special permission - if ((target != user) && (!user->HasPrivPermission("users/samode-usermodes", true))) + if ((target != user) && (!user->HasPrivPermission("users/samode-usermodes"))) + { + user->WriteNotice("*** You are not allowed to /SAMODE other users (the privilege users/samode-usermodes is needed to /SAMODE others)."); return CMD_FAILURE; + } } // XXX: Make ModeParser clear LastParse @@ -93,7 +101,7 @@ class ModuleSaMode : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Provides command SAMODE to allow opers to change modes on channels and users", VF_VENDOR); + return Version("Adds the /SAMODE command which allows server operators to change the modes of a target (channel, user) that they would not otherwise have the privileges to change.", VF_VENDOR); } ModResult OnPreMode(User* source, User* dest, Channel* channel, Modes::ChangeList& modes) CXX11_OVERRIDE @@ -124,8 +132,8 @@ class ModuleSaMode : public Module void Prioritize() CXX11_OVERRIDE { - Module* disabled = ServerInstance->Modules->Find("m_disabled.so"); - ServerInstance->Modules->SetPriority(this, I_OnRawMode, PRIORITY_BEFORE, disabled); + Module* disable = ServerInstance->Modules->Find("m_disable.so"); + ServerInstance->Modules->SetPriority(this, I_OnRawMode, PRIORITY_BEFORE, disable); Module *override = ServerInstance->Modules->Find("m_override.so"); ServerInstance->Modules->SetPriority(this, I_OnPreMode, PRIORITY_BEFORE, override);