guichet/view-home.go

41 lines
685 B
Go
Raw Normal View History

2023-07-26 06:31:43 +00:00
/*
home show the home page
*/
package main
import "net/http"
func handleHome(w http.ResponseWriter, r *http.Request) {
templateHome := getTemplate("home.html")
login := checkLogin(w, r)
if login == nil {
status := handleLogin(w, r)
if status == nil {
return
}
login = checkLogin(w, r)
}
can_admin := false
if login != nil {
can_admin = login.Common.CanAdmin
}
data := HomePageData{
Login: NestedLoginTplData{
Login: login,
},
BaseDN: config.BaseDN,
Org: config.Org,
Common: NestedCommonTplData{
CanAdmin: can_admin,
CanInvite: true,
LoggedIn: true,
},
}
templateHome.Execute(w, data)
}