From d78bb8fabb9c3fefe353bf5ae5855141b4eece94 Mon Sep 17 00:00:00 2001
From: Robert Munteanu <robert.munteanu@gmail.com>
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 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/core/ldap_api.php b/core/ldap_api.php
index ec2f7ea..5d737e2 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" );
-- 
1.6.4.2

