mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Slightly nicer UI for LDAP login test
This commit is contained in:
parent
f1a6926ad9
commit
b107280b7b
|
@ -107,11 +107,15 @@ class SettingsController extends Controller
|
|||
try {
|
||||
$connection = Ldap::connectToLdap();
|
||||
try {
|
||||
\Log::debug('attempting to bind to LDAP for LDAP test');
|
||||
\Log::debug('Attempting to bind to LDAP for LDAP test');
|
||||
Ldap::bindAdminToLdap($connection);
|
||||
try {
|
||||
$ldap_user = Ldap::findAndBindUserLdap($request->input('ldaptest_user'), $request->input('ldaptest_password'));
|
||||
return response()->json(['message' => 'It worked! '. $request->input('username').' successfully binded to LDAP.'], 200);
|
||||
if ($ldap_user) {
|
||||
return response()->json(['message' => 'It worked! '. $request->input('username').' successfully binded to LDAP.'], 200);
|
||||
}
|
||||
return response()->json(['message' => 'Login Failed. '. $request->input('username').' successfully binded to LDAP.'], 400);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
\Log::debug('LDAP login failed');
|
||||
return response()->json(['message' => $e->getMessage()], 400);
|
||||
|
|
|
@ -361,11 +361,15 @@
|
|||
<div class="col-md-3">
|
||||
<a class="btn btn-default btn-sm" id="ldaptestlogin" style="margin-right: 10px;">Test LDAP</a>
|
||||
</div>
|
||||
<span id="ldaptestloginicon"></span>
|
||||
<span id="ldaptestloginicon"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
|
||||
<span id="ldaptestloginresult"></span>
|
||||
<span id="ldaptestloginstatus"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<p class="help-block">Enter a valid LDAP username and password to test whether your LDAP login is configured correctly.</p>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue