summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-23 20:43:04 -0500
committerUnknwon <u@gogs.io>2015-11-23 20:43:04 -0500
commitec8d41765d507e1f0b04ccf94dc934a0026498f2 (patch)
tree31380c0a12e8f3b551d4f1ecfac70712cef2a1a8
parentffbeda077cde63ab2893097af2f5c09df5d06b8f (diff)
downloadgitea-ec8d41765d507e1f0b04ccf94dc934a0026498f2.tar.gz
gitea-ec8d41765d507e1f0b04ccf94dc934a0026498f2.zip
some fix to #2026
-rw-r--r--.gopmfile2
-rw-r--r--models/login.go7
-rw-r--r--models/user.go1
3 files changed, 5 insertions, 5 deletions
diff --git a/.gopmfile b/.gopmfile
index 81e1a2f4ba..1f3dbe5052 100644
--- a/.gopmfile
+++ b/.gopmfile
@@ -6,7 +6,7 @@ github.com/bradfitz/gomemcache = commit:72a68649ba
github.com/codegangsta/cli = commit:0302d39
github.com/go-macaron/binding = commit:864a5ce
github.com/go-macaron/cache = commit:5617353
-github.com/go-macaron/captcha = commit:875ff77
+github.com/go-macaron/captcha =
github.com/go-macaron/csrf = commit:3372b25
github.com/go-macaron/gzip = commit:4938e9b
github.com/go-macaron/i18n = commit:5e728b6
diff --git a/models/login.go b/models/login.go
index 011d946a47..6fde7457ac 100644
--- a/models/login.go
+++ b/models/login.go
@@ -410,7 +410,7 @@ func LoginUserPAMSource(u *User, name, passwd string, sourceId int64, cfg *PAMCo
// fake a local user creation
u = &User{
LowerName: strings.ToLower(name),
- Name: strings.ToLower(name),
+ Name: name,
LoginType: PAM,
LoginSource: sourceId,
LoginName: name,
@@ -418,8 +418,7 @@ func LoginUserPAMSource(u *User, name, passwd string, sourceId int64, cfg *PAMCo
Passwd: passwd,
Email: name,
}
- err := CreateUser(u)
- return u, err
+ return u, CreateUser(u)
}
func ExternalUserLogin(u *User, name, passwd string, source *LoginSource, autoRegister bool) (*User, error) {
@@ -443,7 +442,7 @@ func ExternalUserLogin(u *User, name, passwd string, source *LoginSource, autoRe
func UserSignIn(uname, passwd string) (*User, error) {
var u *User
if strings.Contains(uname, "@") {
- u = &User{Email: uname}
+ u = &User{Email: strings.ToLower(uname)}
} else {
u = &User{LowerName: strings.ToLower(uname)}
}
diff --git a/models/user.go b/models/user.go
index 750f59e5c4..892399c961 100644
--- a/models/user.go
+++ b/models/user.go
@@ -433,6 +433,7 @@ func CreateUser(u *User) (err error) {
return ErrUserAlreadyExist{u.Name}
}
+ u.Email = strings.ToLower(u.Email)
isExist, err = IsEmailUsed(u.Email)
if err != nil {
return err