Make it compatible with the previous version.
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@ -19,10 +19,7 @@ var (
|
||||
)
|
||||
|
||||
func AnnCheck() {
|
||||
if resAnn == "true" {
|
||||
AnnPage()
|
||||
Announcements()
|
||||
} else {
|
||||
if resAnn == "false" {
|
||||
log.Println("[Segfautils] ℹ Announcements are disabled")
|
||||
http.HandleFunc("/announcements", func(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "Announcements are disabled.", http.StatusServiceUnavailable)
|
||||
@ -30,6 +27,9 @@ func AnnCheck() {
|
||||
http.HandleFunc("/api/announcements", func(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "{\"enabled\": \"false\"}", http.StatusServiceUnavailable)
|
||||
})
|
||||
} else {
|
||||
AnnPage()
|
||||
Announcements()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,14 +22,14 @@ var (
|
||||
)
|
||||
|
||||
func FormCheck() {
|
||||
if resForm == "true" {
|
||||
FormPage()
|
||||
Form()
|
||||
} else {
|
||||
if resForm == "false" {
|
||||
log.Println("[Segfautils] ℹ Contact form is disabled")
|
||||
http.HandleFunc("/form", func(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "Form is disabled.", http.StatusServiceUnavailable)
|
||||
})
|
||||
} else {
|
||||
FormPage()
|
||||
Form()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user