diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-03-17 22:24:11 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-03-17 22:24:11 -0400 |
commit | 24c224ddc224f68521f3143d66754742311d2a83 (patch) | |
tree | 689a17275fde1a34aff385ee466a1778e9aca877 /app/Core/Ldap | |
parent | e3e08d0e3436e3cf2f951321861e1a274cc2ebbd (diff) |
Added support for multiple placeholders for LDAP_USER_FILTER
Diffstat (limited to 'app/Core/Ldap')
-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); } } |