From 23eec252748c3ac7af2ae310aeac4ee4c9061fe9 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 6 Nov 2014 22:06:41 -0500 Subject: Fix #605, fix #255, fix #101 --- modules/middleware/context.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/middleware/context.go') diff --git a/modules/middleware/context.go b/modules/middleware/context.go index c45206a9..d2620fed 100644 --- a/modules/middleware/context.go +++ b/modules/middleware/context.go @@ -53,6 +53,7 @@ type Context struct { GitRepo *git.Repository BranchName string TagName string + TreeName string CommitId string RepoLink string CloneLink struct { @@ -176,7 +177,10 @@ func Contexter() macaron.Handler { ctx.IsSigned = true ctx.Data["IsSigned"] = ctx.IsSigned ctx.Data["SignedUser"] = ctx.User + ctx.Data["SignedUserName"] = ctx.User.Name ctx.Data["IsAdmin"] = ctx.User.IsAdmin + } else { + ctx.Data["SignedUserName"] = "" } // If request sends files, parse them here otherwise the Query() can't be parsed and the CsrfToken will be invalid. -- cgit v1.2.3