Explorar el Código

feat(ldap): Validate additional required fields.

If the user selects 'Custom' LDAP Directory, when they hit save, validate the additional required fields ('ldap_group_objectclass' and 'ldap_group_member_attribute') for this selection to function.

Issue #13738
version-14
Jon Lockwood hace 4 años
padre
commit
3beea20ddd
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. +5
    -0
      frappe/integrations/doctype/ldap_settings/ldap_settings.py

+ 5
- 0
frappe/integrations/doctype/ldap_settings/ldap_settings.py Ver fichero

@@ -44,6 +44,11 @@ class LDAPSettings(Document):
frappe.throw(_("Ensure the user and group search paths are correct."),
title=_("Misconfigured"))

if self.ldap_directory_server.lower() == 'custom':
if not self.ldap_group_member_attribute or not self.ldap_group_mappings_section:
frappe.throw(_("Custom LDAP Directoy Selected, please ensure 'LDAP Group Member attribute' and 'LDAP Group Mappings' are entered"),
title=_("Misconfigured"))

else:
frappe.throw(_("LDAP Search String must be enclosed in '()' and needs to contian the user placeholder {0}, eg sAMAccountName={0}"))



Cargando…
Cancelar
Guardar