View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0010230 | mantisbt | ldap | public | 2009-03-19 10:46 | 2011-08-05 02:45 |
Reporter | tk | Assigned To | rombert | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | duplicate | ||
Product Version | 1.2.0a3 | ||||
Summary | 0010230: LDAP: ldap_email_from_username( $p_username ) cannot handle undefined email | ||||
Description | If e-mail is to be obtained from LDAP and for a user in LDAP e-mail is not defined submit issue will inidcate error since function ldap_email_from_username( $p_username ) in core/ldap_api.php does not handle this case correctly. Problem is due to
where the return value accesses an undefined array element. According to php error message we have in this case
| ||||
Tags | No tags attached. | ||||
to consider: http://de3.php.net/manual/de/function.ldap-get-entries.php
|
|
I've worked out a solution now. I have
The most important point is the sequence
which masks off user accounts that have no mail attached. |
|
Regrettably the problem still exists (I admit I have the error switches set to halt in case of php-problems). I.e., I mean the sequence
|
|
I've seen that the ldap.api code in my freshly installed mantis 1.2.5 has been greatly enhanced. In my setting, I query the users' email adresses via the LDAP api from our AD-server. I suppose that in case of a nonexisting data element the AD server returns someting like a void container, so that the error handlings rules in core/ldap.api, lines 259 and 265 are too weak:
In debug mode I get for problematic the message that the second agument of the array_key_exists expression, i.e., $t_info[0], is NULL.
i.e., checking that $t_info[0] actually exists. |
|
Hi tk, Did you have a look at 0012960 ? That issue was recently fixed (although after the release of 1.2.5) and seems quite similar to the problem you reported. If that's the case, you may want to download a nightly build of 1.2.x to test and confirm. |
|
Hi dregard, yes, this is exactly what I've seen. I directly applied the patch attached to 0012960 and confirmed that this patch also works. Thank you! |
|
Thanks for taking the time to look for duplicates and confirming that it works. Closing as requested. |
|
MantisBT: master-1.2.x d58b9ccf 2009-07-19 21:00 Details Diff |
Fixes 0010230: LDAP: ldap_email_from_username( ) cannot handle undefined email. |
Affected Issues 0010230 |
|
mod - core/ldap_api.php | Diff File | ||
MantisBT: master 0f11c6f3 2009-07-19 21:00 Details Diff |
Fixes 0010230: LDAP: ldap_email_from_username( ) cannot handle undefined email. |
Affected Issues 0010230 |
|
mod - core/ldap_api.php | Diff File |