Rename public group URLs to halls
This commit is contained in:
+4
-4
@@ -34,7 +34,7 @@ func checkAdmin(w http.ResponseWriter, r *http.Request) bool {
|
||||
// checkPasswordAdmin checks whether the client authentifies as either an
|
||||
// administrator or the given user. It is used to check whether the
|
||||
// client has the right to change user's password.
|
||||
func checkPasswordAdmin(w http.ResponseWriter, r *http.Request, groupname, user string, wildcard bool) bool {
|
||||
func checkPasswordAdmin(w http.ResponseWriter, r *http.Request, hallname, user string, wildcard bool) bool {
|
||||
username, password, ok := r.BasicAuth()
|
||||
if ok {
|
||||
ok, err := adminMatch(username, password)
|
||||
@@ -47,11 +47,11 @@ func checkPasswordAdmin(w http.ResponseWriter, r *http.Request, groupname, user
|
||||
}
|
||||
}
|
||||
if ok && !wildcard && username == user {
|
||||
desc, err := group.GetDescription(groupname)
|
||||
desc, err := group.GetDescription(hallname)
|
||||
if err != nil {
|
||||
internalError(w,
|
||||
"Get description for group %v: %v",
|
||||
groupname, err,
|
||||
hallname, err,
|
||||
)
|
||||
return false
|
||||
}
|
||||
@@ -169,7 +169,7 @@ func apiHandler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
w.Header().Set("cache-control", "no-cache")
|
||||
sendJSON(w, r, stats.GetGroups())
|
||||
case ".groups":
|
||||
case ".halls":
|
||||
apiGroupHandler(w, r, rest)
|
||||
default:
|
||||
http.NotFound(w, r)
|
||||
|
||||
Reference in New Issue
Block a user