|
|
|
@ -131,7 +131,20 @@ func getPending(w http.ResponseWriter, r *http.Request) {
@@ -131,7 +131,20 @@ func getPending(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
notFoundPage(w, r) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func getConfig(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
defer log.PanicSafe() |
|
|
|
|
loggedIn, _ := detectUser(r, "getConfig") |
|
|
|
|
if loggedIn { |
|
|
|
|
pending, err := json.Marshal(config) |
|
|
|
|
if err != nil { |
|
|
|
|
log.LogErrorType(err) |
|
|
|
|
notFoundPage(w, r) |
|
|
|
|
} |
|
|
|
|
fmt.Fprintf(w, string(pending)) |
|
|
|
|
} else { |
|
|
|
|
notFoundPage(w, r) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
func getProbations(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
defer log.PanicSafe() |
|
|
|
|
loggedIn, _ := detectUser(r, "getProbations") |
|
|
|
@ -222,6 +235,7 @@ func runWeb() {
@@ -222,6 +235,7 @@ func runWeb() {
|
|
|
|
|
router.HandleFunc("/pass", passPage) |
|
|
|
|
router.HandleFunc("/login", loginPage) |
|
|
|
|
router.HandleFunc("/api/login", tryLogin) |
|
|
|
|
router.HandleFunc("/api/config", getConfig) |
|
|
|
|
router.HandleFunc("/api/pending", getPending) |
|
|
|
|
router.HandleFunc("/api/verifications", getVerifications) |
|
|
|
|
router.HandleFunc("/api/probations", getProbations) |
|
|
|
|