mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Added debugging logs
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
c7b300a50d
commit
f66ce02756
|
@ -58,11 +58,13 @@ class SettingsController extends Controller
|
||||||
Log::info('Preparing to test LDAP bind connection');
|
Log::info('Preparing to test LDAP bind connection');
|
||||||
// Test user can bind to the LDAP server
|
// Test user can bind to the LDAP server
|
||||||
try {
|
try {
|
||||||
|
Log::info('Testing Bind');
|
||||||
$ldap->testLdapAdBindConnection();
|
$ldap->testLdapAdBindConnection();
|
||||||
$message['bind'] = [
|
$message['bind'] = [
|
||||||
'message' => 'Successfully binded to LDAP server.'
|
'message' => 'Successfully binded to LDAP server.'
|
||||||
];
|
];
|
||||||
} catch (\Exception $ex) {
|
} catch (\Exception $ex) {
|
||||||
|
Log::info('LDAP Bind failed');
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'message' => 'Error binding to LDAP server, error: ' . $ex->getMessage()
|
'message' => 'Error binding to LDAP server, error: ' . $ex->getMessage()
|
||||||
], 400);
|
], 400);
|
||||||
|
@ -72,11 +74,13 @@ class SettingsController extends Controller
|
||||||
Log::info('Preparing to get sample user set from LDAP directory');
|
Log::info('Preparing to get sample user set from LDAP directory');
|
||||||
// Get a sample of 10 users so user can verify the data is correct
|
// Get a sample of 10 users so user can verify the data is correct
|
||||||
try {
|
try {
|
||||||
|
Log::info('Testing LDAP sync');
|
||||||
$users = $ldap->testUserImportSync();
|
$users = $ldap->testUserImportSync();
|
||||||
$message['user_sync'] = [
|
$message['user_sync'] = [
|
||||||
'users' => $users
|
'users' => $users
|
||||||
];
|
];
|
||||||
} catch (\Exception $ex) {
|
} catch (\Exception $ex) {
|
||||||
|
Log::info('LDAP sync failed');
|
||||||
$message['user_sync'] = [
|
$message['user_sync'] = [
|
||||||
'message' => 'Error getting users from LDAP directory, error: ' . $ex->getMessage()
|
'message' => 'Error getting users from LDAP directory, error: ' . $ex->getMessage()
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue