fix search for mediawiki
This commit is contained in:
@@ -2,7 +2,6 @@ package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
)
|
||||
|
||||
func GetMail(user string) string {
|
||||
@@ -15,14 +14,19 @@ func GetLdapName(user string) string {
|
||||
|
||||
func GetUser(name string) string {
|
||||
endIndex := len(name) - BaseLenght
|
||||
if endIndex < 0 {
|
||||
return ""
|
||||
}
|
||||
user := name[UidLenght:endIndex]
|
||||
log.Print("User ", user)
|
||||
return user
|
||||
}
|
||||
|
||||
func GetSearchUser(name string) string {
|
||||
startIndex := UidLenght + 1
|
||||
endIndex := len(name) - 1
|
||||
if endIndex < 0 {
|
||||
return ""
|
||||
}
|
||||
user := name[startIndex:endIndex]
|
||||
return user
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user