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 {
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)

View File

@ -13,11 +13,11 @@
</tr>
<tr>
<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>
<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>
<tr>
<td>Secret:</td>
@ -39,8 +39,8 @@
</div>
<script>
function check() {
if(document.getElementById('psw').value ===
document.getElementById('confirm_psw').value) {
if(document.getElementById('password').value ===
document.getElementById('confirm_password').value) {
document.getElementById('message').innerHTML = "Passwords match";
} else {
document.getElementById('message').innerHTML = "Passwords don't match";