two more
This commit is contained in:
parent
187d9d2ce2
commit
6d43965c1f
6
main.go
6
main.go
|
@ -58,7 +58,7 @@ func UsernameAvailable(username string) bool {
|
||||||
var tmp string
|
var tmp string
|
||||||
u := strings.ToLower(username)
|
u := strings.ToLower(username)
|
||||||
|
|
||||||
q := fmt.Sprintf("select username from %s_auth where username ILIKE $1", c.TablePrefix)
|
q := fmt.Sprintf("select username from %s_auth where username = $1", c.TablePrefix)
|
||||||
err := c.db.Get(&tmp, q, u)
|
err := c.db.Get(&tmp, q, u)
|
||||||
if err == sql.ErrNoRows {
|
if err == sql.ErrNoRows {
|
||||||
return true
|
return true
|
||||||
|
@ -95,8 +95,8 @@ func Register(username, email, ip string) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
log.Printf("scsusers.Register: Failed to send registration email, deleting user %s\n", username)
|
log.Printf("scsusers.Register: Failed to send registration email, deleting user %s\n", username)
|
||||||
q = fmt.Sprintf("delete from %s_auth where username ILIKE $1 AND password=$2", c.TablePrefix)
|
q = fmt.Sprintf("delete from %s_auth where username = $1 AND password=$2", c.TablePrefix)
|
||||||
_, err = c.db.Exec(q, username, string(crypt))
|
_, err = c.db.Exec(q, u, string(crypt))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("scsusers.Register: Failed to delete new user %s: %s\n", username, err.Error())
|
log.Printf("scsusers.Register: Failed to delete new user %s: %s\n", username, err.Error())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue