mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[feature/auth-refactor] Fix LDAP conversion error
I messed up when converting over auth_ldap this commit fixes that error. I have not been able to extensively test ldap due to not having ldap set up on this computer yet. Apache authentication appears to work. PHPBB3-9734
This commit is contained in:
@@ -338,11 +338,11 @@ class phpbb_auth_provider_ldap implements phpbb_auth_provider_interface
|
||||
*
|
||||
* @return string A filter string for ldap_search
|
||||
*/
|
||||
public function ldap_user_filter($username)
|
||||
private function ldap_user_filter($username)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$filter = '(' . $config['ldap_uid'] . '=' . ldap_escape(htmlspecialchars_decode($username)) . ')';
|
||||
$filter = '(' . $config['ldap_uid'] . '=' . $this->ldap_escape(htmlspecialchars_decode($username)) . ')';
|
||||
if ($config['ldap_user_filter'])
|
||||
{
|
||||
$_filter = ($config['ldap_user_filter'][0] == '(' && substr($config['ldap_user_filter'], -1) == ')') ? $config['ldap_user_filter'] : "({$config['ldap_user_filter']})";
|
||||
@@ -354,7 +354,7 @@ class phpbb_auth_provider_ldap implements phpbb_auth_provider_interface
|
||||
/**
|
||||
* Escapes an LDAP AttributeValue
|
||||
*/
|
||||
public function escape($string)
|
||||
private function ldap_escape($string)
|
||||
{
|
||||
return str_replace(array('*', '\\', '(', ')'), array('\\*', '\\\\', '\\(', '\\)'), $string);
|
||||
}
|
||||
|
Reference in New Issue
Block a user