From 18b71b10867e19c73746e1f260a20640f3e8f45a Mon Sep 17 00:00:00 2001 From: Steve Date: Thu, 17 Sep 2020 19:53:02 -0400 Subject: [PATCH] fix getting password from registration form --- ldap.go | 3 +++ templates/register.html | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) 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 @@ Password: - + Confirm Password: - + Secret: @@ -39,8 +39,8 @@