aboutsummaryrefslogtreecommitdiff
path: root/directory.go
diff options
context:
space:
mode:
Diffstat (limited to 'directory.go')
-rw-r--r--directory.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/directory.go b/directory.go
index c36bd41..b1e563d 100644
--- a/directory.go
+++ b/directory.go
@@ -10,6 +10,9 @@ import (
"github.com/gorilla/mux"
)
+const FIELD_NAME_PROFILE_PICTURE = "profilePicture"
+const FIELD_NAME_DIRECTORY_VISIBILITY = "directoryVisibility"
+
func handleDirectory(w http.ResponseWriter, r *http.Request) {
templateDirectory := template.Must(template.ParseFiles("templates/layout.html", "templates/directory.html"))
@@ -51,8 +54,14 @@ func handleSearch(w http.ResponseWriter, r *http.Request) {
searchRequest := ldap.NewSearchRequest(
config.UserBaseDN,
ldap.ScopeSingleLevel, ldap.NeverDerefAliases, 0, 0, false,
- "(&(objectclass=organizationalPerson)(visibility=on))",
- []string{config.UserNameAttr, "displayname", "mail", "description"},
+ "(&(objectclass=organizationalPerson)("+FIELD_NAME_DIRECTORY_VISIBILITY+"=on))",
+ []string{
+ config.UserNameAttr,
+ "displayname",
+ "mail",
+ "description",
+ FIELD_NAME_PROFILE_PICTURE,
+ },
nil)
sr, err := login.conn.Search(searchRequest)