mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	@@ -969,26 +969,28 @@ function initAdmin() {
 | 
				
			|||||||
    // New authentication
 | 
					    // New authentication
 | 
				
			||||||
    if ($('.admin.new.authentication').length > 0) {
 | 
					    if ($('.admin.new.authentication').length > 0) {
 | 
				
			||||||
        $('#auth_type').change(function () {
 | 
					        $('#auth_type').change(function () {
 | 
				
			||||||
            $('.ldap').hide();
 | 
					            $('.ldap, .dldap, .smtp, .pam, .has-tls').hide();
 | 
				
			||||||
            $('.dldap').hide();
 | 
					
 | 
				
			||||||
            $('.smtp').hide();
 | 
					            $('.ldap input[required], .dldap input[required], .smtp input[required], .pam input[required], .has-tls input[required]').removeAttr('required');
 | 
				
			||||||
            $('.pam').hide();
 | 
					 | 
				
			||||||
            $('.has-tls').hide();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var authType = $(this).val();
 | 
					            var authType = $(this).val();
 | 
				
			||||||
            switch (authType) {
 | 
					            switch (authType) {
 | 
				
			||||||
                case '2':     // LDAP
 | 
					                case '2':     // LDAP
 | 
				
			||||||
                    $('.ldap').show();
 | 
					                    $('.ldap').show();
 | 
				
			||||||
 | 
					                    $('.ldap div.required input').attr('required', 'required');
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                case '3':     // SMTP
 | 
					                case '3':     // SMTP
 | 
				
			||||||
                    $('.smtp').show();
 | 
					                    $('.smtp').show();
 | 
				
			||||||
                    $('.has-tls').show();
 | 
					                    $('.has-tls').show();
 | 
				
			||||||
 | 
					                    $('.smtp div.required input, .has-tls').attr('required', 'required');
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                case '4':     // PAM
 | 
					                case '4':     // PAM
 | 
				
			||||||
                    $('.pam').show();
 | 
					                    $('.pam').show();
 | 
				
			||||||
 | 
					                    $('.pam input').attr('required', 'required');
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                case '5':     // LDAP
 | 
					                case '5':     // LDAP
 | 
				
			||||||
                    $('.dldap').show();
 | 
					                    $('.dldap').show();
 | 
				
			||||||
 | 
					                    $('.dldap div.required input').attr('required', 'required');
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -996,6 +998,7 @@ function initAdmin() {
 | 
				
			|||||||
                onSecurityProtocolChange()
 | 
					                onSecurityProtocolChange()
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					        $('#auth_type').change();
 | 
				
			||||||
        $('#security_protocol').change(onSecurityProtocolChange)
 | 
					        $('#security_protocol').change(onSecurityProtocolChange)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    // Edit authentication
 | 
					    // Edit authentication
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user