mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Try for better error reporting on LDAP fail
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
This commit is contained in:
parent
b107280b7b
commit
bcf435f625
|
@ -112,9 +112,10 @@ class SettingsController extends Controller
|
||||||
try {
|
try {
|
||||||
$ldap_user = Ldap::findAndBindUserLdap($request->input('ldaptest_user'), $request->input('ldaptest_password'));
|
$ldap_user = Ldap::findAndBindUserLdap($request->input('ldaptest_user'), $request->input('ldaptest_password'));
|
||||||
if ($ldap_user) {
|
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) {
|
} catch (\Exception $e) {
|
||||||
\Log::debug('LDAP login failed');
|
\Log::debug('LDAP login failed');
|
||||||
|
|
Loading…
Reference in a new issue