fix getting password from registration form

This commit is contained in:
stryan 2020-09-17 19:53:02 -04:00
parent 10fb809271
commit 18b71b1086
2 changed files with 7 additions and 4 deletions

View File

@ -9,6 +9,9 @@ import (
) )
func createLDAPAccount(uname string, pwd string, email string) error { func createLDAPAccount(uname string, pwd string, email string) error {
if uname == "" || pwd == "" || email == "" {
return errors.New("Missing field")
}
url := Conf.Ldap.Url url := Conf.Ldap.Url
newdn := fmt.Sprintf("%v=%v,%v,%v", Conf.Ldap.UserAttr, uname, Conf.Ldap.UserOu, Conf.Ldap.LdapDc) 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) binddn := fmt.Sprintf("%v,%v", Conf.Ldap.AdminUser, Conf.Ldap.LdapDc)

View File

@ -13,11 +13,11 @@
</tr> </tr>
<tr> <tr>
<td>Password:</td> <td>Password:</td>
<td><input type="password" id="psw" name="psw" pattern="(?=.*\d)(?=.*[a-z]).{8,}" title="Must contain at least one number and at least 8 or more characters" required></td> <td><input type="password" id="password" name="password" pattern="(?=.*\d)(?=.*[a-z]).{8,}" title="Must contain at least one number and at least 8 or more characters" required></td>
</tr> </tr>
<tr> <tr>
<td>Confirm Password:</td> <td>Confirm Password:</td>
<td><input type="password" name="confirm_password" id="confirm_psw" onchange="check()"/></td> <td><input type="password" name="confirm_password" id="confirm_password" onchange="check()"/></td>
<td><span id='message'></span></td> <td><span id='message'></span></td>
<tr> <tr>
<td>Secret:</td> <td>Secret:</td>
@ -39,8 +39,8 @@
</div> </div>
<script> <script>
function check() { function check() {
if(document.getElementById('psw').value === if(document.getElementById('password').value ===
document.getElementById('confirm_psw').value) { document.getElementById('confirm_password').value) {
document.getElementById('message').innerHTML = "Passwords match"; document.getElementById('message').innerHTML = "Passwords match";
} else { } else {
document.getElementById('message').innerHTML = "Passwords don't match"; document.getElementById('message').innerHTML = "Passwords don't match";