summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-12 20:35:35 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-12 20:35:35 -0400
commit90f6aa8cd19e489723ddffc40d6507782c29756c (patch)
treee247229573a4d32ca1d508619951a9868690840f /routers/user
parent23bba7633bbd8ae8f9f41404352c327f9e8c9fdc (diff)
downloadgitea-90f6aa8cd19e489723ddffc40d6507782c29756c.tar.gz
gitea-90f6aa8cd19e489723ddffc40d6507782c29756c.zip
Add repo mirror and import
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/user.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/routers/user/user.go b/routers/user/user.go
index 8585267a64..e5328173a2 100644
--- a/routers/user/user.go
+++ b/routers/user/user.go
@@ -74,6 +74,20 @@ func Profile(ctx *middleware.Context, params martini.Params) {
ctx.HTML(200, "user/profile")
}
+func Email2User(ctx *middleware.Context) {
+ u, err := models.GetUserByEmail(ctx.Query("email"))
+ if err != nil {
+ if err == models.ErrUserNotExist {
+ ctx.Handle(404, "user.Email2User", err)
+ } else {
+ ctx.Handle(500, "user.Email2User(GetUserByEmail)", err)
+ }
+ return
+ }
+
+ ctx.Redirect("/user/" + u.Name)
+}
+
func SignIn(ctx *middleware.Context) {
ctx.Data["Title"] = "Log In"