aboutsummaryrefslogtreecommitdiff
path: root/directory.go
diff options
context:
space:
mode:
authordarkgallium <darkgallium@deuxfleurs.fr>2021-08-18 12:44:44 +0200
committerdarkgallium <darkgallium@deuxfleurs.fr>2021-08-18 12:44:44 +0200
commit59c29e9c76952933c19f2ae9d9ae0bf7076d7e35 (patch)
tree9edebe95b65254f60a087a24219148b637f87e7b /directory.go
parenta187ae72cbd5960a0778679fba7535d67796f27e (diff)
downloadguichet-59c29e9c76952933c19f2ae9d9ae0bf7076d7e35.tar.gz
guichet-59c29e9c76952933c19f2ae9d9ae0bf7076d7e35.zip
show everyone in the directory page by defaultshow-everyone-by-default
Diffstat (limited to 'directory.go')
-rw-r--r--directory.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/directory.go b/directory.go
index 06afdf2..ab5dea3 100644
--- a/directory.go
+++ b/directory.go
@@ -43,7 +43,7 @@ func handleDirectorySearch(w http.ResponseWriter, r *http.Request) {
r.ParseMultipartForm(1024)
input := strings.TrimSpace(strings.Join(r.Form["query"], ""))
- if r.Method != "POST" || input == "" {
+ if r.Method != "POST" {
http.Error(w, "Invalid request", http.StatusBadRequest)
return
}
@@ -79,7 +79,8 @@ func handleDirectorySearch(w http.ResponseWriter, r *http.Request) {
results := []SearchResult{}
for _, values := range sr.Entries {
- if ContainsI(values.GetAttributeValue(config.UserNameAttr), input) ||
+ if input == "" ||
+ ContainsI(values.GetAttributeValue(config.UserNameAttr), input) ||
ContainsI(values.GetAttributeValue("displayname"), input) ||
ContainsI(values.GetAttributeValue("mail"), input) {
results = append(results, SearchResult{