fix search for mediawiki

This commit is contained in:
Kylie Czar
2022-08-28 00:16:08 -03:00
parent 5541c8f827
commit ce348a7a96
2 changed files with 43 additions and 23 deletions

View File

@@ -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
}