diff --git a/ldap.go b/ldap.go index 8d38366..84d1745 100644 --- a/ldap.go +++ b/ldap.go @@ -9,6 +9,9 @@ import ( ) func createLDAPAccount(uname string, pwd string, email string) error { + if uname == "" || pwd == "" || email == "" { + return errors.New("Missing field") + } url := Conf.Ldap.Url newdn := fmt.Sprintf("%v=%v,%v,%v", Conf.Ldap.UserAttr, uname, Conf.Ldap.UserOu, Conf.Ldap.LdapDc) binddn := fmt.Sprintf("%v,%v", Conf.Ldap.AdminUser, Conf.Ldap.LdapDc) diff --git a/templates/register.html b/templates/register.html index e456dc7..6eb140a 100644 --- a/templates/register.html +++ b/templates/register.html @@ -13,11 +13,11 @@