Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Fix retrieving ldap login attribute #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/auth_ldap/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function init($host) {
$host->add_hook($host::HOOK_AUTH_USER, $this);
}

private function _log($msg, $level = E_USER_NOTICE, $file = '', $line = '', $context = '') {
private function _log($msg, $level = E_USER_NOTICE, $file = '', $line = 0, $context = '') {
$loggerFunction = Logger::get();
if (is_object($loggerFunction)) {
$loggerFunction->log_error($level, $msg, $file, $line, $context);
Expand Down Expand Up @@ -331,7 +331,7 @@ function authenticate($login, $password) {

//Searching for user
$filterObj = str_replace('???', $this->ldap_escape($login), LDAP_AUTH_SEARCHFILTER);
$searchResults = @ldap_search($ldapConn, $this->_baseDN, $filterObj, array('displayName', 'title', 'sAMAccountName'), 0, 0, 0);
$searchResults = @ldap_search($ldapConn, $this->_baseDN, $filterObj, array('displayName', 'title', $this->_ldapLoginAttrib), 0, 0, 0);
if ($searchResults === FALSE) {
$this->_log('LDAP Search Failed on base \'' . $this->_baseDN . '\' for \'' . $filterObj . '\'', E_USER_ERROR);
return FALSE;
Expand Down