From 1ee7aa6ac550b6dbe9039dfe996651bbf4f487ba Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Sat, 30 Apr 2011 23:21:37 +0200 Subject: [PATCH] GroupMemberCheck: Implement token matching. --- group.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/group.go b/group.go index 0956125..673dd05 100644 --- a/group.go +++ b/group.go @@ -181,8 +181,12 @@ func GroupMemberCheck(current *Channel, aclchan *Channel, name string, client *C if token { // The user is part of this group if the remaining name is part of - // his access token list. - log.Printf("GroupMemberCheck: Implement token matching") + // his access token list. The name check is case-insensitive. + for _, clientToken := range client.Tokens { + if strings.ToLower(name) == strings.ToLower(clientToken) { + return true + } + } return false } else if hash { // The user is part of this group if the remaining name matches his