diff options
author | Sadie Powell <sadie@witchery.services> | 2025-04-14 11:31:19 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-04-14 11:31:19 +0100 |
commit | d04a312d0d1edd1223b55ed89b7fb707ceca3117 (patch) | |
tree | 39b0c165b17d5ff4571423b2bc279b34546c3b72 /modules/ldap_oper.cpp | |
parent | 099f0ce43a7e34e4a6e74d91aa911c745c262ba8 (diff) |
Add Anope::Templace and switch all template strings to use it.
Diffstat (limited to 'modules/ldap_oper.cpp')
-rw-r--r-- | modules/ldap_oper.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/ldap_oper.cpp b/modules/ldap_oper.cpp index fa57f7aa9..4d62052cd 100644 --- a/modules/ldap_oper.cpp +++ b/modules/ldap_oper.cpp @@ -117,8 +117,17 @@ public: throw LDAPException("Could not search LDAP for opertype settings, invalid configuration."); if (!this->binddn.empty()) - this->ldap->Bind(NULL, this->binddn.replace_all_cs("%a", u->Account()->display), this->password.c_str()); - this->ldap->Search(new IdentifyInterface(this, u), this->basedn, this->filter.replace_all_cs("%a", u->Account()->display)); + { + auto bdn = Anope::Template(this->binddn, { + { "account", u->Account()->display }, + }); + this->ldap->Bind(NULL, bdn, this->password.c_str()); + } + + auto af = Anope::Template(this->filter, { + { "account", u->Account()->display }, + }); + this->ldap->Search(new IdentifyInterface(this, u), this->basedn, af); } catch (const LDAPException &ex) { |