Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
f0d4fa3b
Commit
f0d4fa3b
authored
9 years ago
by
Guy Antony Halse
Browse files
Options
Downloads
Patches
Plain Diff
use LDAP_OPT_DIAGNOSTIC_MESSAGE for better error reporting in LDAP
(as suggested by jhaar in issue #120 and used by us)
parent
743d6509
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/SimpleSAML/Auth/LDAP.php
+7
-0
7 additions, 0 deletions
lib/SimpleSAML/Auth/LDAP.php
with
7 additions
and
0 deletions
lib/SimpleSAML/Auth/LDAP.php
+
7
−
0
View file @
f0d4fa3b
...
@@ -10,6 +10,10 @@ define('ERR_AS_DATA_INCONSIST', 4);
...
@@ -10,6 +10,10 @@ define('ERR_AS_DATA_INCONSIST', 4);
define
(
'ERR_AS_INTERNAL'
,
5
);
define
(
'ERR_AS_INTERNAL'
,
5
);
define
(
'ERR_AS_ATTRIBUTE'
,
6
);
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.
* The LDAP class holds helper functions to access an LDAP database.
...
@@ -146,6 +150,9 @@ class SimpleSAML_Auth_LDAP {
...
@@ -146,6 +150,9 @@ class SimpleSAML_Auth_LDAP {
}
else
{
}
else
{
if
(
$errNo
!==
0
)
{
if
(
$errNo
!==
0
)
{
$description
.
=
'; cause: \''
.
ldap_error
(
$this
->
ldap
)
.
'\' (0x'
.
dechex
(
$errNo
)
.
')'
;
$description
.
=
'; cause: \''
.
ldap_error
(
$this
->
ldap
)
.
'\' (0x'
.
dechex
(
$errNo
)
.
')'
;
if
(
@
ldap_get_option
(
$this
->
ldap
,
LDAP_OPT_DIAGNOSTIC_MESSAGE
,
$extendedError
)
and
!
empty
(
$extendedError
))
{
$description
.
=
'; additional: \''
.
$extendedError
.
'\''
;
}
}
}
switch
(
$errNo
){
switch
(
$errNo
){
case
0x20
://
LDAP_NO_SUCH_OBJECT
case
0x20
://
LDAP_NO_SUCH_OBJECT
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment