Skip to content

Commit

Permalink
Fix #646 (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim authored and lunny committed Jan 14, 2017
1 parent 769f779 commit 88f45ce
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -969,33 +969,36 @@ function initAdmin() {
// New authentication
if ($('.admin.new.authentication').length > 0) {
$('#auth_type').change(function () {
$('.ldap').hide();
$('.dldap').hide();
$('.smtp').hide();
$('.pam').hide();
$('.has-tls').hide();
$('.ldap, .dldap, .smtp, .pam, .has-tls').hide();

$('.ldap input[required], .dldap input[required], .smtp input[required], .pam input[required], .has-tls input[required]').removeAttr('required');

var authType = $(this).val();
switch (authType) {
case '2': // LDAP
$('.ldap').show();
$('.ldap div.required input').attr('required', 'required');
break;
case '3': // SMTP
$('.smtp').show();
$('.has-tls').show();
$('.smtp div.required input, .has-tls').attr('required', 'required');
break;
case '4': // PAM
$('.pam').show();
$('.pam input').attr('required', 'required');
break;
case '5': // LDAP
$('.dldap').show();
$('.dldap div.required input').attr('required', 'required');
break;
}

if (authType == '2' || authType == '5') {
onSecurityProtocolChange()
}
});
$('#auth_type').change();
$('#security_protocol').change(onSecurityProtocolChange)
}
// Edit authentication
Expand Down

0 comments on commit 88f45ce

Please sign in to comment.