Update uploadHandler.go
Cette révision appartient à :
Parent
bba5faa58a
révision
e86627abed
|
@ -17,16 +17,22 @@ import (
|
|||
|
||||
func UploadHandler(w http.ResponseWriter, r *http.Request) {
|
||||
user := GetUser(r)
|
||||
if config.UploadsDisabled && config.AdminsAreStillAllowedTo && user.Status != 2 && config.TrustedUsersAreStillAllowedTo && user.Status != 1 {
|
||||
|
||||
if config.UploadsDisabled {
|
||||
|
||||
if config.AdminsAreStillAllowedTo && user.Status != 2 && config.TrustedUsersAreStillAllowedTo && user.Status != 1 {
|
||||
http.Error(w, "Error uploads are disabled", http.StatusInternalServerError)
|
||||
return
|
||||
} else if config.UploadsDisabled && !config.AdminsAreStillAllowedTo && user.Status == 2 {
|
||||
} else if !config.AdminsAreStillAllowedTo && user.Status == 2 {
|
||||
http.Error(w, "Error uploads are disabled", http.StatusInternalServerError)
|
||||
return
|
||||
} else if config.UploadsDisabled && !config.TrustedUsersAreStillAllowedTo && user.Status == 1 {
|
||||
} else if !config.TrustedUsersAreStillAllowedTo && user.Status == 1 {
|
||||
http.Error(w, "Error uploads are disabled", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var uploadForm UploadForm
|
||||
if r.Method == "POST" {
|
||||
defer r.Body.Close()
|
||||
|
|
Référencer dans un nouveau ticket