diff options
Diffstat (limited to 'modules/middleware/context.go')
-rw-r--r-- | modules/middleware/context.go | 4 |
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. |