X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_check.cpp;h=f19f610e941ee14bd8e7a881d733b474d2c40825;hb=80e81e3b81b779901fd9d67f8ae030ee30c0bcec;hp=abbaaab8d41ee8fc3166a8a347fdd9421325f651;hpb=193eac649066bda33e693baadce6bc40181008f0;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index abbaaab8d..f19f610e9 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -1,10 +1,15 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Matt Schatz + * Copyright (C) 2013-2016 Attila Molnar + * Copyright (C) 2013, 2017-2021 Sadie Powell + * Copyright (C) 2012, 2019 Robby + * Copyright (C) 2010 Craig Edwards * Copyright (C) 2009-2010 Daniel De Graaf + * Copyright (C) 2009 Uli Schlachter * Copyright (C) 2007 Dennis Friis - * Copyright (C) 2006-2007 Robin Burchell - * Copyright (C) 2006 Craig Edwards + * Copyright (C) 2006-2008 Robin Burchell * * 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 @@ -90,7 +95,7 @@ class CheckContext for(Extensible::ExtensibleStore::const_iterator i = ext->GetExtList().begin(); i != ext->GetExtList().end(); ++i) { ExtensionItem* item = i->first; - std::string value = item->serialize(FORMAT_USER, ext, i->second); + std::string value = item->ToHuman(ext, i->second); if (!value.empty()) Write("meta:" + item->name, value); else if (!item->name.empty()) @@ -141,12 +146,22 @@ class CommandCheck : public Command return ret; } + static std::string GetAllowedOperOnlySnomasks(LocalUser* user) + { + std::string ret; + for (unsigned char sno = 'A'; sno <= 'z'; ++sno) + if (ServerInstance->SNO->IsSnomaskUsable(sno) && user->HasSnomaskPermission(sno)) + ret.push_back(sno); + return ret; + } + public: CommandCheck(Module* parent) : Command(parent,"CHECK", 1) , snomaskmode(parent, "snomask") { - flags_needed = 'o'; syntax = "||| []"; + flags_needed = 'o'; + syntax = "||| []"; } CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE @@ -203,6 +218,7 @@ class CommandCheck : public Command { context.Write("chanmodeperms", GetAllowedOperOnlyModes(loctarg, MODETYPE_CHANNEL)); context.Write("usermodeperms", GetAllowedOperOnlyModes(loctarg, MODETYPE_USER)); + context.Write("snomaskperms", GetAllowedOperOnlySnomasks(loctarg)); context.Write("commandperms", oper->AllowedOperCommands.ToString()); context.Write("permissions", oper->AllowedPrivs.ToString()); } @@ -216,6 +232,8 @@ class CommandCheck : public Command std::string classname = loctarg->GetClass()->name; if (!classname.empty()) context.Write("connectclass", classname); + + context.Write("exempt", loctarg->exempt ? "yes" : "no"); } else context.Write("onip", targuser->GetIPString()); @@ -322,7 +340,7 @@ class ModuleCheck : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Provides the CHECK command to view user, channel, IP address or hostname information", VF_VENDOR|VF_OPTCOMMON); + return Version("Adds the /CHECK command which allows server operators to look up details about a channel, user, IP address, or hostname.", VF_VENDOR|VF_OPTCOMMON); } };