35 lines
573 B
Go
35 lines
573 B
Go
/*
|
|
home show the home page
|
|
*/
|
|
|
|
package main
|
|
|
|
import "net/http"
|
|
|
|
type HomePageData struct {
|
|
Login *LoginStatus
|
|
BaseDN string
|
|
Org string
|
|
CanAdmin bool
|
|
LoggedIn bool
|
|
}
|
|
|
|
func handleHome(w http.ResponseWriter, r *http.Request) {
|
|
|
|
login := checkLogin(w, r)
|
|
if login == nil {
|
|
handleLogin(w, r)
|
|
return
|
|
}
|
|
|
|
templateHome := getTemplate("home.html")
|
|
data := &HomePageData{
|
|
Login: login,
|
|
BaseDN: config.BaseDN,
|
|
Org: config.Org,
|
|
CanAdmin: login.CanAdmin,
|
|
LoggedIn: true,
|
|
}
|
|
templateHome.Execute(w, data)
|
|
|
|
}
|