summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-05-15 22:34:36 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-05-15 22:34:36 +0800
commitf4486f3eec1856559f52291c283fe076352fccfe (patch)
tree43b51feb85e41c5791e5c110326cce3e2705042c /models
parent4f042d12bd0cd45a47b3d7347112e685801d3bef (diff)
downloadgitea-f4486f3eec1856559f52291c283fe076352fccfe.tar.gz
gitea-f4486f3eec1856559f52291c283fe076352fccfe.zip
bug fixed #193
Diffstat (limited to 'models')
-rw-r--r--models/login.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/models/login.go b/models/login.go
index be185488ac..aa82eb0036 100644
--- a/models/login.go
+++ b/models/login.go
@@ -16,6 +16,7 @@ import (
"github.com/go-xorm/xorm"
"github.com/gogits/gogs/modules/auth/ldap"
+ "github.com/gogits/gogs/modules/log"
)
// Login types.
@@ -194,14 +195,17 @@ func LoginUser(uname, passwd string) (*User, error) {
u, err := LoginUserLdapSource(nil, uname, passwd,
source.Id, source.Cfg.(*LDAPConfig), true)
if err == nil {
- return u, err
+ return u, nil
+ } else {
+ log.Warn("try ldap login", source.Name, "by", uname, "error:", err)
}
} else if source.Type == LT_SMTP {
u, err := LoginUserSMTPSource(nil, uname, passwd,
source.Id, source.Cfg.(*SMTPConfig), true)
-
if err == nil {
- return u, err
+ return u, nil
+ } else {
+ log.Warn("try smtp login", source.Name, "by", uname, "error:", err)
}
}
}