@@ -272,6 +272,7 @@ function getNewLoginShell() {
272272 }
273273 return $("#customLoginBox").val();
274274 }
275+
275276 function isLoginShellValid(x) {
276277 if (x.trim().length === 0) {
277278 return false;
@@ -282,21 +283,31 @@ function isLoginShellValid(x) {
282283 }
283284 return true;
284285 }
286+
287+ function enableOrDisableCustomLoginBoxHighlight() {
288+ if (
289+ ($("#loginSelector").val() == "Custom") &&
290+ !isLoginShellValid($("#customLoginBox").val())
291+ ) {
292+ $("#customLoginBox").css("box-shadow", "0 0 0 0.3rem rgba(220, 53, 69, 0.25)");
293+ } else {
294+ $("#customLoginBox").css("box-shadow", "none");
295+ }
296+ }
297+ $("#customLoginBox").on("input", enableOrDisableCustomLoginBoxHighlight);
298+ enableOrDisableCustomLoginBoxHighlight();
299+
285300 function enableOrDisableSubmitLoginShell() {
286- var submitLoginShell = $("#submitLoginShell");
287301 var newLoginShell = getNewLoginShell();
288302 if (!isLoginShellValid(newLoginShell)) {
289- submitLoginShell.attr("disabled", true);
290- $("#customLoginBox").css("box-shadow", "0 0 0 0.3rem rgba(220, 53, 69, 0.25)");
303+ $("#submitLoginShell").attr("disabled", true);
291304 return;
292- } else {
293- $("#customLoginBox").css("box-shadow", "none");
294305 }
295306 if (newLoginShell == ldapLoginShell) {
296- submitLoginShell.attr("disabled", true);
307+ $("# submitLoginShell") .attr("disabled", true);
297308 return;
298309 }
299- submitLoginShell.attr("disabled", false);
310+ $("# submitLoginShell") .attr("disabled", false);
300311 }
301312 $("#customLoginBox").on("input", enableOrDisableSubmitLoginShell);
302313 $("#loginSelector").change(enableOrDisableSubmitLoginShell);
0 commit comments