aboutsummaryrefslogtreecommitdiff
path: root/directory.go
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-08-16 15:30:14 +0200
committerAlex Auvolat <alex@adnab.me>2021-08-16 15:30:14 +0200
commite94bd728ec7f709883fb232b2eb123543ba5660e (patch)
treec7f75a9055e370df38dbba0c0f5b0c75a9dd649d /directory.go
parent9e3279b9c04bb07d108fa820a72841b4082c0979 (diff)
downloadguichet-Add_Directory.tar.gz
guichet-Add_Directory.zip
Improve profile editing page & photo uploadingAdd_Directory
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)