From cb02abb46810cd65255114d82c90788847556f60 Mon Sep 17 00:00:00 2001 From: JediKev Date: Thu, 16 May 2024 15:15:47 +0000 Subject: [PATCH] ldap: Instance Name This addresses an issue where if you have more than one LDAP instance running it will show "Active Directory or LDAP" for all instances making it hard to differentiate the instances. This updates the `getName()` function to grab the name from the config if available otherwise defaults to the default name. --- auth-ldap/authentication.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth-ldap/authentication.php b/auth-ldap/authentication.php index 2f93de8..40d2475 100644 --- a/auth-ldap/authentication.php +++ b/auth-ldap/authentication.php @@ -433,7 +433,7 @@ function authenticate($username, $password=false, $errors=array()) { function getName() { $config = $this->config; list($__, $_N) = $config->translate(); - return $__(static::$name); + return $config->getName() ?: $__(static::$name); } function lookup($dn) { @@ -472,7 +472,7 @@ function __construct($config) { function getName() { $config = $this->config; list($__, $_N) = $config->translate(); - return $__(static::$name); + return $config->getName() ?: $__(static::$name); } function authenticate($username, $password=false, $errors=array()) {