mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-03 23:56:22 -07:00
Make wordfilter editing work
This commit is contained in:
parent
97eaabeee3
commit
462f1b3c6a
2 changed files with 47 additions and 8 deletions
|
@ -653,6 +653,37 @@ var actions = []Action{
|
|||
Callback: func(writer http.ResponseWriter, request *http.Request, wantsJSON bool) (output interface{}, err error) {
|
||||
managePageBuffer := bytes.NewBufferString("")
|
||||
editIDstr := request.FormValue("edit")
|
||||
|
||||
submitBtn := request.FormValue("dowordfilter")
|
||||
switch submitBtn {
|
||||
case "Edit wordfilter":
|
||||
regexCheckStr := request.FormValue("isregex")
|
||||
if regexCheckStr == "on" {
|
||||
regexCheckStr = "1"
|
||||
} else {
|
||||
regexCheckStr = "0"
|
||||
}
|
||||
_, err = gcsql.ExecSQL(`UPDATE DBPREFIXwordfilters
|
||||
SET board_dirs = ?,
|
||||
staff_note = ?,
|
||||
search = ?,
|
||||
is_regex = ?,
|
||||
change_to = ?
|
||||
WHERE id = ?`,
|
||||
request.FormValue("boarddirs"),
|
||||
request.FormValue("staffnote"),
|
||||
request.FormValue("find"),
|
||||
regexCheckStr,
|
||||
request.FormValue("replace"),
|
||||
editIDstr,
|
||||
)
|
||||
case "Create new wordfilter":
|
||||
|
||||
}
|
||||
if err != nil {
|
||||
return err, err
|
||||
}
|
||||
|
||||
wordfilters, err := gcsql.GetWordFilters()
|
||||
if err != nil {
|
||||
return wordfilters, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue