Skip to content
Snippets Groups Projects
Commit 38df40d8 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Merge branch 'feature/ldap-verbose-errors'

parents 8b054fec 34ddead3
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,10 @@ define('ERR_AS_DATA_INCONSIST', 4);
define('ERR_AS_INTERNAL', 5);
define('ERR_AS_ATTRIBUTE', 6);
// not defined in earlier PHP versions
if (!defined('LDAP_OPT_DIAGNOSTIC_MESSAGE')) {
define('LDAP_OPT_DIAGNOSTIC_MESSAGE', 0x0032);
}
/**
* The LDAP class holds helper functions to access an LDAP database.
......@@ -146,6 +150,9 @@ class SimpleSAML_Auth_LDAP {
}else{
if ($errNo !== 0) {
$description .= '; cause: \'' . ldap_error($this->ldap) . '\' (0x' . dechex($errNo) . ')';
if (@ldap_get_option($this->ldap, LDAP_OPT_DIAGNOSTIC_MESSAGE, $extendedError) && !empty($extendedError)) {
$description .= '; additional: \'' . $extendedError . '\'';
}
}
switch ($errNo){
case 0x20://LDAP_NO_SUCH_OBJECT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment