diff options
Diffstat (limited to 'app/Core/Ldap/User.php')
-rw-r--r-- | app/Core/Ldap/User.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/Core/Ldap/User.php b/app/Core/Ldap/User.php index d36d6f34..52283434 100644 --- a/app/Core/Ldap/User.php +++ b/app/Core/Ldap/User.php @@ -211,14 +211,15 @@ class User * * @access public * @param string $username + * @param string $filter * @return string */ - public function getLdapUserPattern($username) + public function getLdapUserPattern($username, $filter = LDAP_USER_FILTER) { - if (! LDAP_USER_FILTER) { + if (! $filter) { throw new LogicException('LDAP user filter empty, check the parameter LDAP_USER_FILTER'); } - return sprintf(LDAP_USER_FILTER, $username); + return str_replace('%s', $username, $filter); } } |