Skip to content

Commit 88f45ce

Browse files
shyimlunny
authored andcommitted
1 parent 769f779 commit 88f45ce

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

public/js/index.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -969,33 +969,36 @@ function initAdmin() {
969969
// New authentication
970970
if ($('.admin.new.authentication').length > 0) {
971971
$('#auth_type').change(function () {
972-
$('.ldap').hide();
973-
$('.dldap').hide();
974-
$('.smtp').hide();
975-
$('.pam').hide();
976-
$('.has-tls').hide();
972+
$('.ldap, .dldap, .smtp, .pam, .has-tls').hide();
973+
974+
$('.ldap input[required], .dldap input[required], .smtp input[required], .pam input[required], .has-tls input[required]').removeAttr('required');
977975

978976
var authType = $(this).val();
979977
switch (authType) {
980978
case '2': // LDAP
981979
$('.ldap').show();
980+
$('.ldap div.required input').attr('required', 'required');
982981
break;
983982
case '3': // SMTP
984983
$('.smtp').show();
985984
$('.has-tls').show();
985+
$('.smtp div.required input, .has-tls').attr('required', 'required');
986986
break;
987987
case '4': // PAM
988988
$('.pam').show();
989+
$('.pam input').attr('required', 'required');
989990
break;
990991
case '5': // LDAP
991992
$('.dldap').show();
993+
$('.dldap div.required input').attr('required', 'required');
992994
break;
993995
}
994996

995997
if (authType == '2' || authType == '5') {
996998
onSecurityProtocolChange()
997999
}
9981000
});
1001+
$('#auth_type').change();
9991002
$('#security_protocol').change(onSecurityProtocolChange)
10001003
}
10011004
// Edit authentication

0 commit comments

Comments
 (0)