from mac
git-svn-id: svn://losandesgames.com/alfheim-website@8 15359d88-9307-4e75-a9c1-e5686e5897df
This commit is contained in:
parent
c32d594d65
commit
537455a5d4
12
handlers.go
12
handlers.go
@ -48,7 +48,10 @@ func home(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
text, err := template.ParseFiles("ui/base.html", "ui/index.html")
|
||||
id := authenticated_user(r)
|
||||
account, err := users.Get_account(id)
|
||||
|
||||
text, err := template.ParseFiles("base.html", "index.html")
|
||||
if err != nil {
|
||||
http.Error(w, "Internal Server Error", 500)
|
||||
log.Fatal(err)
|
||||
@ -57,7 +60,7 @@ func home(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
|
||||
err = text.Execute(w, templatedata{})
|
||||
err = text.Execute(w, templatedata{AuthenticatedUser: id, Account: account})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
http.Error(w, "Internal Server Error", 500)
|
||||
@ -132,10 +135,13 @@ func logout(w http.ResponseWriter, r *http.Request) {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
id := authenticated_user(r)
|
||||
account, err := users.Get_account(id)
|
||||
|
||||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
|
||||
text.Execute(w, templatedata{})
|
||||
text.Execute(w, templatedata{AuthenticatedUser: id, Account: account})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
http.Error(w, "Internal Server Error", 500)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user