From f2ece54a644ceaa959d65afc82fed4ed0ba1c582 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 15 Apr 2024 22:03:32 +0100 Subject: [PATCH] Remove the v4 svsoper module. This has been merged in to the services module. --- 4/m_svsoper.cpp | 80 ------------------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 4/m_svsoper.cpp diff --git a/4/m_svsoper.cpp b/4/m_svsoper.cpp deleted file mode 100644 index babd86a4..00000000 --- a/4/m_svsoper.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * InspIRCd -- Internet Relay Chat Daemon - * - * Copyright (C) 2013-2016 Sadie Powell - * - * 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 - * License as published by the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/// $ModAuthor: Sadie Powell -/// $ModDepends: core 4 -/// $ModDesc: Allows services to forcibly oper a user. - - -#include "inspircd.h" - -class CommandSVSOper final - : public Command -{ -public: - CommandSVSOper(Module* Creator) - : Command(Creator, "SVSOPER", 2, 2) - { - access_needed = CmdAccess::SERVER; - } - - CmdResult Handle(User* user, const Params& parameters) override - { - if (!user->server->IsService()) - return CmdResult::FAILURE; - - User* target = ServerInstance->Users.FindUUID(parameters[0]); - if (!target) - return CmdResult::FAILURE; - - if (IS_LOCAL(target)) - { - auto iter = ServerInstance->Config->OperTypes.find(parameters[1]); - if (iter == ServerInstance->Config->OperTypes.end()) - return CmdResult::FAILURE; - - auto account = std::make_shared(MODNAME, iter->second, ServerInstance->Config->EmptyTag); - target->OperLogin(account, false, true); - } - return CmdResult::SUCCESS; - } - - RouteDescriptor GetRouting(User* user, const Params& parameters) override - { - User* target = ServerInstance->Users.FindUUID(parameters[0]); - if (!target) - return ROUTE_LOCALONLY; - return ROUTE_OPT_UCAST(target->server); - } -}; - -class ModuleSVSOper final - : public Module -{ -private: - CommandSVSOper command; - -public: - ModuleSVSOper() - : Module(VF_OPTCOMMON, "Allows services to forcibly oper a user.") - , command(this) - { - } -}; - -MODULE_INIT(ModuleSVSOper)