X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_ldapoper.cpp;h=92a47f3b4bd038135a7b713ed847a6e0b55aee79;hb=131f659d91953c51823ef70c8314aa3170ce7a7e;hp=45e83333afd890e09ab05a96d7de0d4d49f2e44e;hpb=124c17e14134a4999afc1a5e981ab7c75b3694b9;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_ldapoper.cpp b/src/modules/m_ldapoper.cpp index 45e83333a..92a47f3b4 100644 --- a/src/modules/m_ldapoper.cpp +++ b/src/modules/m_ldapoper.cpp @@ -1,11 +1,9 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013 Adam - * Copyright (C) 2009 Robin Burchell - * Copyright (C) 2008 Pippijn van Steenhoven - * Copyright (C) 2008 Craig Edwards - * Copyright (C) 2007 Carsten Valdemar Munk + * Copyright (C) 2017-2020 Sadie Powell + * Copyright (C) 2014, 2018 Attila Molnar + * Copyright (C) 2013-2014 Adam * * 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 @@ -45,10 +43,11 @@ class LDAPOperBase : public LDAPInterface if (!oper_command) return; - std::vector params; + CommandBase::Params params; params.push_back(opername); params.push_back(password); - oper_command->Handle(params, user); + ClientProtocol::TagMap tags; + oper_command->Handle(user, CommandBase::Params(params, tags)); } void Fallback() @@ -151,7 +150,13 @@ class AdminBindInterface : public LDAPInterface public: AdminBindInterface(Module* c, const std::string& p, const std::string& u, const std::string& o, const std::string& pa, const std::string& b, const std::string& w) - : LDAPInterface(c), provider(p), user(u), opername(p), password(pa), base(b), what(w) + : LDAPInterface(c) + , provider(p) + , user(u) + , opername(o) + , password(pa) + , base(b) + , what(w) { } @@ -179,14 +184,14 @@ class AdminBindInterface : public LDAPInterface } }; -class ModuleLDAPAuth : public Module +class ModuleLDAPOper : public Module { dynamic_reference LDAP; std::string base; std::string attribute; public: - ModuleLDAPAuth() + ModuleLDAPOper() : LDAP(this, "LDAP") { me = this; @@ -201,7 +206,7 @@ class ModuleLDAPAuth : public Module attribute = tag->getString("attribute"); } - ModResult OnPreCommand(std::string& command, std::vector& parameters, LocalUser* user, bool validated, const std::string& original_line) CXX11_OVERRIDE + ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated) CXX11_OVERRIDE { if (validated && command == "OPER" && parameters.size() >= 2) { @@ -241,8 +246,8 @@ class ModuleLDAPAuth : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Adds the ability to authenticate opers via LDAP", VF_VENDOR); + return Version("Allows server operators to be authenticated against an LDAP database.", VF_VENDOR); } }; -MODULE_INIT(ModuleLDAPAuth) +MODULE_INIT(ModuleLDAPOper)