From 6c366eb1124c9cd0cb0be7c47f3e8bf9bce6f9fc Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 30 Nov 2016 20:39:43 -0800 Subject: [PATCH] Fixes potential login issue if password syncing is set to true --- app/Http/Controllers/Auth/AuthController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 0a8d59b2f4..dcc84461a5 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -124,16 +124,18 @@ class AuthController extends Controller return redirect()->back()->withInput()->withErrors($validator); } $user = null; + // Should we even check for LDAP users? if (Setting::getSettings()->ldap_enabled=='1') { LOG::debug("LDAP is enabled."); try { $user = $this->login_via_ldap($request); Auth::login($user, true); + + // If the user was unable to login via LDAP, log the error and let them fall through to + // local authentication. } catch (\Exception $e) { - if(Setting::getSettings()->ldap_pw_sync!='1') { - return redirect()->back()->withInput()->with('error',$e->getMessage()); - } + LOG::error("There was an error authenticating the LDAP user: ".$e->getMessage()); } }