mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-05 12:05:26 +00:00
LDAP tester
This commit is contained in:
@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
||||
use Input;
|
||||
use Lang;
|
||||
use App\Models\Setting;
|
||||
use App\Models\Ldap;
|
||||
use Redirect;
|
||||
use DB;
|
||||
use Str;
|
||||
@ -428,6 +429,25 @@ class SettingsController extends Controller
|
||||
}
|
||||
|
||||
|
||||
public function getLdapTest() {
|
||||
|
||||
try {
|
||||
$connection = Ldap::connectToLdap();
|
||||
try {
|
||||
Ldap::bindAdminToLdap($connection);
|
||||
return response()->json(['message' => 'It worked!'], 200);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['message' => $e->getMessage()], 500);
|
||||
}
|
||||
return response()->json(['message' => 'It worked!'], 200);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['message' => $e->getMessage()], 500);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the listing of backups
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user