Remove old user and block file pages
This commit is contained in:
@@ -90,65 +90,3 @@ func (wc *WebController) adminGlobalsForm(td *TemplateData, r *http.Request) (f
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
||||
func (wc *WebController) adminAbuseForm(td *TemplateData, r *http.Request) (f Form) {
|
||||
if !td.Authenticated || !td.User.IsAdmin {
|
||||
return Form{Title: ";-)"}
|
||||
}
|
||||
|
||||
f = Form{
|
||||
Name: "admin_file_removal",
|
||||
Title: "Admin file removal",
|
||||
PreFormHTML: template.HTML("<p>Paste any pixeldrain file links in here to remove them</p>"),
|
||||
Fields: []Field{
|
||||
{
|
||||
Name: "text",
|
||||
Label: "Files to delete",
|
||||
Type: FieldTypeTextarea,
|
||||
}, {
|
||||
Name: "type",
|
||||
Label: "Type",
|
||||
DefaultValue: "unknown",
|
||||
Type: FieldTypeRadio,
|
||||
RadioValues: []string{
|
||||
"unknown",
|
||||
"copyright",
|
||||
"child_abuse",
|
||||
"terrorism",
|
||||
"gore",
|
||||
"malware",
|
||||
},
|
||||
}, {
|
||||
Name: "reporter",
|
||||
Label: "Reporter",
|
||||
DefaultValue: "Anonymous tip",
|
||||
Type: FieldTypeText,
|
||||
},
|
||||
},
|
||||
BackLink: "/admin",
|
||||
SubmitLabel: "Submit",
|
||||
}
|
||||
|
||||
if f.ReadInput(r) {
|
||||
resp, err := td.PixelAPI.AdminBlockFiles(
|
||||
f.FieldVal("text"),
|
||||
f.FieldVal("type"),
|
||||
f.FieldVal("reporter"),
|
||||
)
|
||||
if err != nil {
|
||||
formAPIError(err, &f)
|
||||
return
|
||||
}
|
||||
|
||||
successMsg := template.HTML("The following files were blocked:<br/><ul>")
|
||||
for _, v := range resp.FilesBlocked {
|
||||
successMsg += template.HTML("<li>pixeldrain.com/u/" + v + "</li>")
|
||||
}
|
||||
successMsg += "<ul>"
|
||||
|
||||
// Request was a success
|
||||
f.SubmitSuccess = true
|
||||
f.SubmitMessages = []template.HTML{successMsg}
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
Reference in New Issue
Block a user