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
|
||||
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)
|
||||
if err == sql.ErrNoRows {
|
||||
return true
|
||||
|
@ -95,8 +95,8 @@ func Register(username, email, ip string) bool {
|
|||
return true
|
||||
}
|
||||
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)
|
||||
_, err = c.db.Exec(q, username, string(crypt))
|
||||
q = fmt.Sprintf("delete from %s_auth where username = $1 AND password=$2", c.TablePrefix)
|
||||
_, err = c.db.Exec(q, u, string(crypt))
|
||||
if err != nil {
|
||||
log.Printf("scsusers.Register: Failed to delete new user %s: %s\n", username, err.Error())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue