aboutsummaryrefslogtreecommitdiff
path: root/modules/middleware/context.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-11-06 22:06:41 -0500
committerUnknwon <joe2010xtmf@163.com>2014-11-06 22:06:41 -0500
commit23eec252748c3ac7af2ae310aeac4ee4c9061fe9 (patch)
tree9f9d8834ef94451da2fb1d43ba63d0f130d61f79 /modules/middleware/context.go
parent4e7eb5be9d3e9c9ba7238769d2b5f2f471d51b67 (diff)
Fix #605, fix #255, fix #101
Diffstat (limited to 'modules/middleware/context.go')
-rw-r--r--modules/middleware/context.go4
1 files changed, 4 insertions, 0 deletions
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.