POST request logging eingebunden
This commit is contained in:
parent
3848ee3010
commit
634668b7d5
14
events.go
14
events.go
|
@ -19,6 +19,20 @@ func getEvents() []event {
|
||||||
return events
|
return events
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getEventCount() int {
|
||||||
|
db := ctdoConnect()
|
||||||
|
|
||||||
|
row := dbQuerry(db, "SELECT COUNT(*) FROM events;")
|
||||||
|
|
||||||
|
count := 0
|
||||||
|
|
||||||
|
for row.Next() {
|
||||||
|
row.Scan(&count)
|
||||||
|
}
|
||||||
|
|
||||||
|
return count
|
||||||
|
}
|
||||||
|
|
||||||
func addEvent(Event event) bool {
|
func addEvent(Event event) bool {
|
||||||
db := ctdoConnect()
|
db := ctdoConnect()
|
||||||
|
|
||||||
|
|
16
http.go
16
http.go
|
@ -24,6 +24,22 @@ func httpHandleFuncWithPOST(urlPath string, filepath string, contentType string)
|
||||||
if r.Method == "POST" {
|
if r.Method == "POST" {
|
||||||
err := r.ParseForm()
|
err := r.ParseForm()
|
||||||
errorPanic(err)
|
errorPanic(err)
|
||||||
|
|
||||||
|
if filepath == "./web/pages/admin/dashboard.html" {
|
||||||
|
title := r.FormValue("title")
|
||||||
|
description := r.FormValue("description")
|
||||||
|
files := r.FormValue("media")
|
||||||
|
date := r.FormValue("date")
|
||||||
|
|
||||||
|
if title != "" && description != "" && files != "" && date != "" {
|
||||||
|
logger("----------------POST----------------")
|
||||||
|
logger("title: " + title)
|
||||||
|
logger("descrtiption: " + description)
|
||||||
|
logger("media: " + files)
|
||||||
|
logger("date: " + date)
|
||||||
|
logger("----------------POST END----------------")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger(r.Method + " request -> " + readHttpYML() + "/" + urlPath + " <" + contentType + ">")
|
logger(r.Method + " request -> " + readHttpYML() + "/" + urlPath + " <" + contentType + ">")
|
||||||
|
|
Loading…
Reference in New Issue