Redesign file context menus and download archives using global preference
This commit is contained in:
1 parent
6aca927851
commit
042392f611
22 files changed
+530
-363
No files matched your search
@@ -9,6 +9,7 @@ import (
|
||||
)
|
||||
|
||||
type settingsData struct {
|
||||
DownloadArchiveFormat string `json:"downloadArchiveFormat"`
|
||||
Signup bool `json:"signup"`
|
||||
HideLoginButton bool `json:"hideLoginButton"`
|
||||
CreateUserDir bool `json:"createUserDir"`
|
||||
@@ -25,6 +26,7 @@ type settingsData struct {
|
||||
|
||||
var settingsGetHandler = withAdmin(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) {
|
||||
data := &settingsData{
|
||||
DownloadArchiveFormat: d.settings.ArchiveFormat(),
|
||||
Signup: d.settings.Signup,
|
||||
HideLoginButton: d.settings.HideLoginButton,
|
||||
CreateUserDir: d.settings.CreateUserDir,
|
||||
@@ -50,6 +52,10 @@ var settingsPutHandler = withAdmin(func(w http.ResponseWriter, r *http.Request,
|
||||
return http.StatusBadRequest, err
|
||||
}
|
||||
|
||||
if !settings.ValidArchiveFormat(req.DownloadArchiveFormat) {
|
||||
return http.StatusBadRequest, nil
|
||||
}
|
||||
d.settings.DownloadArchiveFormat = req.DownloadArchiveFormat
|
||||
d.settings.Signup = false
|
||||
d.settings.CreateUserDir = req.CreateUserDir
|
||||
d.settings.MinimumPasswordLength = req.MinimumPasswordLength
|
||||
|
||||
Reference in new issue
Block a user