Skip to content
Browse files

LDAP binding calls are made even if $g_login_method <> LDAP

If for some reason $g_use_ldap_email or $g_use_ldap_realname are ON with
$g_login_method <> 'LDAP', binding calls are attempted when retrieving
the user's e-mail or real name.

Adding a check on $g_login_method to avoid this unwanted behavior.

Fixes #14442
  • Loading branch information...
1 parent 5273c40 commit aca7cf7dbfc085c695dc2dd162df598a8e0caac9 @dregad dregad committed Jul 2, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 core/user_api.php
View
4 core/user_api.php
@@ -752,7 +752,7 @@ function user_get_field( $p_user_id, $p_field_name ) {
# lookup the user's email in LDAP or the db as appropriate
function user_get_email( $p_user_id ) {
$t_email = '';
- if( ON == config_get( 'use_ldap_email' ) ) {
+ if( LDAP == config_get( 'login_method' ) && ON == config_get( 'use_ldap_email' ) ) {
$t_email = ldap_email( $p_user_id );
}
if( is_blank( $t_email ) ) {
@@ -766,7 +766,7 @@ function user_get_email( $p_user_id ) {
function user_get_realname( $p_user_id ) {
$t_realname = '';
- if ( ON == config_get( 'use_ldap_realname' ) ) {
+ if ( LDAP == config_get( 'login_method' ) && ON == config_get( 'use_ldap_realname' ) ) {
$t_realname = ldap_realname( $p_user_id );
}

0 comments on commit aca7cf7

Please sign in to comment.
Something went wrong with that request. Please try again.