From 77e7d1d2aafb91f06ede139b2f714801daecc118 Mon Sep 17 00:00:00 2001 From: corux Date: Sat, 7 Nov 2015 12:42:16 +0100 Subject: [PATCH 1/2] Fix default value for line in log entry SQL schema requires the lineno to be a NOT NULL integer. --- plugins/auth_ldap/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/auth_ldap/init.php b/plugins/auth_ldap/init.php index a79191e..74fa017 100644 --- a/plugins/auth_ldap/init.php +++ b/plugins/auth_ldap/init.php @@ -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); From b0fc29789c86c892ae755124d3ddb537400348f0 Mon Sep 17 00:00:00 2001 From: Tobias Wallura Date: Sat, 21 Nov 2015 02:45:36 +0100 Subject: [PATCH 2/2] Fix bug retrieving _ldapLoginAttrib from ldap server --- plugins/auth_ldap/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/auth_ldap/init.php b/plugins/auth_ldap/init.php index 74fa017..40e0d2b 100644 --- a/plugins/auth_ldap/init.php +++ b/plugins/auth_ldap/init.php @@ -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;