From ea1e2ed36280b8e3a4078885a07f7d3398ce5703 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 22 May 2012 03:32:54 +0200 Subject: [PATCH] [ticket/10401] Return correct type when ldap_bind() fails in ldap_login(). ldap_login() is supposed to return an array. PHPBB3-10401 --- phpBB/includes/auth/auth_ldap.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php index 5dfa74ddab..eebf147d48 100644 --- a/phpBB/includes/auth/auth_ldap.php +++ b/phpBB/includes/auth/auth_ldap.php @@ -156,7 +156,11 @@ function login_ldap(&$username, &$password) { if (!@ldap_bind($ldap, htmlspecialchars_decode($config['ldap_user']), htmlspecialchars_decode($config['ldap_password']))) { - return $user->lang['LDAP_NO_SERVER_CONNECTION']; + return array( + 'status' => LOGIN_ERROR_EXTERNAL_AUTH, + 'error_msg' => 'LDAP_NO_SERVER_CONNECTION', + 'user_row' => array('user_id' => ANONYMOUS), + ); } }