Add admin interface
This commit is contained in:
@@ -47,8 +47,15 @@ func (s *Server) handleDelete(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, http.StatusOK, map[string]string{"status": "deleted", "id": id})
|
||||
return
|
||||
}
|
||||
// Deleting from the administration table goes back to it. The destination
|
||||
// is built from configuration, never from the request, so this cannot be
|
||||
// turned into an open redirect.
|
||||
if r.PostFormValue("from") == "admin" {
|
||||
http.Redirect(w, r, s.cfg.BasePath+"admin", http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
s.render(w, http.StatusOK, "error.html", errorPage{
|
||||
page: s.page("Deleted", false),
|
||||
page: s.page(r, "Deleted", false),
|
||||
Status: "Deleted",
|
||||
Message: "The file is gone.",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user