http
This commit is contained in:
@@ -219,9 +219,16 @@ func HttpHandleGroupAddClient(response http.ResponseWriter, request *http.Reques
|
|||||||
}
|
}
|
||||||
|
|
||||||
usersToAddString := request.FormValue("users")
|
usersToAddString := request.FormValue("users")
|
||||||
usersToAdd := strings.SplitN(usersToAddString, ",", int(MaxGroupsForClient))
|
var remainingUsersCount = int(MaxClientsInGroup) - len(group.Clients)
|
||||||
|
if remainingUsersCount < 1 {
|
||||||
|
http.Error(response, "max users", http.StatusUnauthorized)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
usersToAdd := strings.SplitN(usersToAddString, ",", remainingUsersCount+1)
|
||||||
if len(usersToAdd) == 0 {
|
if len(usersToAdd) == 0 {
|
||||||
http.Error(response, "no users to add", http.StatusBadRequest)
|
http.Error(response, "no users to add", http.StatusBadRequest)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user