mirror of https://github.com/jumpserver/jumpserver
				
				
				
			[Bugfix] 修复取消LDAP认证不成功bug
							parent
							
								
									c1db33713f
								
							
						
					
					
						commit
						486793ddcd
					
				| 
						 | 
				
			
			@ -34,7 +34,7 @@ def refresh_all_settings_on_django_ready(sender, **kwargs):
 | 
			
		|||
def ldap_auth_on_changed(sender, enabled=True, **kwargs):
 | 
			
		||||
    if enabled:
 | 
			
		||||
        logger.debug("Enable LDAP auth")
 | 
			
		||||
        if settings.AUTH_LDAP_BACKEND not in settings.AUTH_LDAP_BACKEND:
 | 
			
		||||
        if settings.AUTH_LDAP_BACKEND not in settings.AUTHENTICATION_BACKENDS:
 | 
			
		||||
            settings.AUTHENTICATION_BACKENDS.insert(0, settings.AUTH_LDAP_BACKEND)
 | 
			
		||||
 | 
			
		||||
    else:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -82,7 +82,7 @@ class LDAPSettingView(AdminUserRequiredMixin, TemplateView):
 | 
			
		|||
        if form.is_valid():
 | 
			
		||||
            form.save()
 | 
			
		||||
            if "AUTH_LDAP" in form.cleaned_data:
 | 
			
		||||
                ldap_auth_enable.send(form.cleaned_data["AUTH_LDAP"])
 | 
			
		||||
                ldap_auth_enable.send(sender=self.__class__, enabled=form.cleaned_data["AUTH_LDAP"])
 | 
			
		||||
            msg = _("Update setting successfully, please restart program")
 | 
			
		||||
            messages.success(request, msg)
 | 
			
		||||
            return redirect('settings:ldap-setting')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue