LDAP setting fields validation updates.

This commit is contained in:
Aaron Tan
2017-06-30 15:30:59 -04:00
parent 430d4bc28e
commit 2c69d433e9
3 changed files with 15 additions and 3 deletions

View File

@@ -32,7 +32,8 @@ def validate_ldap_dn_with_user(value):
def validate_ldap_bind_dn(value):
if not re.match(r'^[A-Za-z][A-Za-z0-9._-]*?\\[A-Za-z0-9 ._-]+?$', value.strip()):
if not re.match(r'^[A-Za-z][A-Za-z0-9._-]*?\\[A-Za-z0-9 ._-]+?$', value.strip()) and \
not re.match(r'^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$', value.strip()):
validate_ldap_dn(value)