aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-11 11:54:43 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-11 11:54:43 -0400
commitaf5435d58640144cdf29b955ecf96b8792bf6484 (patch)
tree2abcc56f7a98ef34a4d7037f99da0109d82c54c6
parent12f81de349b9793c6f8f14b11af32ee94a735d5f (diff)
Bug fix
2 files changed, 5 insertions, 2 deletions
diff --git a/modules/auth/user.go b/modules/auth/user.go
index 215cffed..4059edfd 100644
--- a/modules/auth/user.go
+++ b/modules/auth/user.go
@@ -20,6 +20,9 @@ func SignedInId(session sessions.Session) int64 {
return 0
}
if s, ok := userId.(int64); ok {
+ if _, err := models.GetUserById(s); err != nil {
+ return 0
+ }
return s
}
return 0
diff --git a/templates/user/signup.tmpl b/templates/user/signup.tmpl
index cfbf27fd..ba41b0c9 100644
--- a/templates/user/signup.tmpl
+++ b/templates/user/signup.tmpl
@@ -7,7 +7,7 @@
<div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}">
<label class="col-md-4 control-label">Username: </label>
<div class="col-md-6">
- <input name="username" class="form-control" placeholder="Type your username" value="{{.username}}" required="required" title="Username must contain at least has 5 characters">
+ <input name="username" class="form-control" placeholder="Type your username" value="{{.username}}" required="required" title="Username must contain at least 5 characters">
</div>
</div>
@@ -21,7 +21,7 @@
<div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}">
<label class="col-md-4 control-label">Password: </label>
<div class="col-md-6">
- <input name="passwd" type="password" class="form-control" placeholder="Type your password" required="required" title="Password must contain at least has 6 characters">
+ <input name="passwd" type="password" class="form-control" placeholder="Type your password" required="required" title="Password must contain at least 6 characters">
</div>
</div>