View Issue Details

IDProjectCategoryView StatusLast Update
0026629mantisbtldappublic2020-02-09 07:04
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Target Version2.23.1Fixed in Version2.23.1 
Summary0026629: LDAP API throws PHP warning when ldap_connect() fails
Description

When ldap_connect() fails (e.g. due to invalid server specification set in $g_ldap_server), the following warnings are triggered:

SYSTEM WARNING: 'ldap_errno() expects parameter 1 to be resource, bool given' in '/path/to/core/ldap_api.php' line 50
SYSTEM WARNING: 'ldap_error() expects parameter 1 to be resource, bool given' in '/path/to/core/ldap_api.php' line 50

This is because the function returns false in this case, and this value is passed on to ldap_log_error() which expects a resource.

TagsNo tags attached.

Activities

Related Changesets

MantisBT: master-2.23 212d1834

2020-01-27 07:26:59

dregad

Details Diff
Fix PHP warning when ldap_connect_bind() fails

ldap_errno() / ldap_error() expect a resource, but the link identifier
is `false`.

- ldap_cache_user_data(): replace ldap_log_error() by a generic
log_event() call
- ldap_authenticate_by_username(): remove the whole if statement, which
is useless as ldap_connect_bind() will throw an error that will halt
program execution if the connection fails.

Fixes 0026629
Affected Issues
0026629
mod - core/ldap_api.php Diff File

Issue History

Date Modified Username Field Change
2020-01-27 08:38 dregad New Issue
2020-01-27 08:48 dregad Assigned To => dregad
2020-01-27 08:48 dregad Status new => assigned
2020-01-27 08:48 dregad Note Added: 0063519
2020-01-28 07:07 dregad Changeset attached => MantisBT master-2.23 212d1834
2020-01-28 07:07 dregad Status assigned => resolved
2020-01-28 07:07 dregad Resolution open => fixed
2020-01-28 07:15 dregad Fixed in Version => 2.23.1
2020-02-09 07:04 atrol Target Version => 2.23.1