Browse Source

fix context

tags/v0.9.99
slene 10 years ago
parent
commit
9cdded911b
1 changed files with 8 additions and 5 deletions
  1. 8
    5
      modules/middleware/context.go

+ 8
- 5
modules/middleware/context.go View File

@@ -60,12 +60,15 @@ func InitContext() martini.Handler {
// Get user from session if logined.
user := auth.SignedInUser(session)
ctx.User = user
ctx.IsSigned = ctx != nil
ctx.IsSigned = user != nil

data["IsSigned"] = true
data["SignedUser"] = user
data["SignedUserId"] = user.Id
data["SignedUserName"] = user.LowerName
data["IsSigned"] = ctx.IsSigned

if user != nil {
data["SignedUser"] = user
data["SignedUserId"] = user.Id
data["SignedUserName"] = user.LowerName
}

c.Map(ctx)
c.Map(data)

Loading…
Cancel
Save