From bcf435f625b552d3dfbb0282edca996df1dcf427 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 16 Oct 2017 06:46:33 -0700 Subject: [PATCH] Try for better error reporting on LDAP fail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sorry for all the commits on this - my local LDAP isn’t working and I can’t figure out why, so no easy way to test locally --- app/Http/Controllers/Api/SettingsController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/SettingsController.php b/app/Http/Controllers/Api/SettingsController.php index 9230a21ec7..2edae03199 100644 --- a/app/Http/Controllers/Api/SettingsController.php +++ b/app/Http/Controllers/Api/SettingsController.php @@ -112,9 +112,10 @@ class SettingsController extends Controller try { $ldap_user = Ldap::findAndBindUserLdap($request->input('ldaptest_user'), $request->input('ldaptest_password')); if ($ldap_user) { - return response()->json(['message' => 'It worked! '. $request->input('username').' successfully binded to LDAP.'], 200); + \Log::debug('It worked! '. $request->input('ldaptest_user').' successfully binded to LDAP.'); + return response()->json(['message' => 'It worked! '. $request->input('ldaptest_user').' successfully binded to LDAP.'], 200); } - return response()->json(['message' => 'Login Failed. '. $request->input('username').' successfully binded to LDAP.'], 400); + return response()->json(['message' => 'Login Failed. '. $request->input('ldaptest_user').' successfully binded to LDAP.'], 400); } catch (\Exception $e) { \Log::debug('LDAP login failed');