From: <gi...@ma...> - 2011-05-26 19:54:13
|
The branch, master has been updated via c5610d6fe9919fb90ddc61556a45f638e6f0306d (commit) from 7b763277d428bae04306760bb4e5518aea423bc7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c5610d6fe9919fb90ddc61556a45f638e6f0306d Author: Lapinkiller <lap...@ho...> Date: Thu May 26 19:02:33 2011 +0200 Fix bug when user not in ldap Fixes: #12960 Email / Realname lookups against LDAP spew warning when account is not in LDAP Signed-off-by: Robert Munteanu <rob...@gm...> ----------------------------------------------------------------------- Summary of changes: core/ldap_api.php | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) ----------------------------------------------------------------------- commit c5610d6fe9919fb90ddc61556a45f638e6f0306d Author: Lapinkiller <lap...@ho...> Date: Thu May 26 19:02:33 2011 +0200 Fix bug when user not in ldap Fixes: #12960 Email / Realname lookups against LDAP spew warning when account is not in LDAP Signed-off-by: Robert Munteanu <rob...@gm...> diff --git a/core/ldap_api.php b/core/ldap_api.php index ba2986a..9557abe 100644 --- a/core/ldap_api.php +++ b/core/ldap_api.php @@ -236,8 +236,14 @@ function ldap_get_field_from_username( $p_username, $p_field ) { return null; } - $t_value = $t_info[0][$p_field][0]; - log_event( LOG_LDAP, "Found value '{$t_value}' for field '{$p_field}'." ); + # Make sure the requested field exists + if( is_array($t_info[0]) && array_key_exists( $p_field, $t_info[0] ) ) { + $t_value = $t_info[0][$p_field][0]; + log_event( LOG_LDAP, "Found value '{$t_value}' for field '{$p_field}'." ); + } else { + log_event( LOG_LDAP, "WARNING: field '$p_field' does not exist" ); + return null; + } return $t_value; } ----------------------------------------------------------------------- -- Mantis Bug Tracker |