From aa457a1a4c4a2f6f4da3962761ee3cc4749d6f90 Mon Sep 17 00:00:00 2001 From: Robert Munteanu Date: Sat, 31 Oct 2009 00:06:10 +0200 Subject: [PATCH] Issue #11100: Avoid warnings when the ldap simulation files is not found --- core/ldap_api.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/ldap_api.php b/core/ldap_api.php index ec2f7eafdc..5d737e2609 100644 --- a/core/ldap_api.php +++ b/core/ldap_api.php @@ -395,6 +395,10 @@ function ldap_simulation_get_user( $p_username ) { $t_filename = config_get( 'ldap_simulation_file_path' ); $t_lines = file( $t_filename ); + if ( $t_lines === false ) { + log_event( LOG_LDAP, "ldap_simulation_get_user: could not read simulation data from $t_filename." ); + return null; + } foreach ( $t_lines as $t_line ) { $t_line = trim( $t_line, " \t\r\n" );