From 3b34e53a8e648afbf540fdb0dce924d693658345 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 17 Jan 2015 11:15:34 +0800 Subject: [PATCH] . --- session/users.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/session/users.go b/session/users.go index 10033c6..dc5116b 100644 --- a/session/users.go +++ b/session/users.go @@ -24,6 +24,7 @@ import ( "path/filepath" "runtime" "strconv" + "strings" "sync" "text/template" "time" @@ -337,11 +338,11 @@ func addUser(username, password, email string) string { defer addUserMutex.Unlock() for _, user := range conf.Users { - if user.Name == username { + if strings.ToLower(user.Name) == strings.ToLower(username) { return userExists } - if user.Email == email { + if strings.ToLower(user.Email) == strings.ToLower(email) { return emailExists } }