Implementing Activate User

This commit is contained in:
Chris Mann 2023-07-21 07:33:43 +02:00
parent 860c7d8067
commit f00f59ce0b
2 changed files with 9 additions and 4 deletions

View file

@ -56,7 +56,7 @@ func handleAdminActivateUsers(w http.ResponseWriter, r *http.Request) {
config.InvitationBaseDN,
ldap.ScopeSingleLevel, ldap.NeverDerefAliases, 0, 0, false,
fmt.Sprintf("(&(objectClass=organizationalPerson))"),
[]string{config.UserNameAttr, "dn", "displayName", "givenName", "sn", "mail", "uid", "cn"},
[]string{config.UserNameAttr, "displayName", "givenName", "sn", "mail", "uid", "cn"},
nil)
sr, err := login.conn.Search(searchRequest)

View file

@ -3,20 +3,25 @@
{{define "body"}}
<table class="table mt-4">
<thead>
<th scope="col">Identifiant</th>
<th scope="col">Nom complet</th>
<th scope="col">Login</th>
<th scope="col">Email</th>
<th scope="col">Nom d'ffichage</th>
<th scope="col">Prénom</th>
<th scope="col">Nom de famille</th>
<th scope="col">description</th>
</thead>
<tbody>
{{with $root := .}}
{{range $user := $root.Users}}
<tr>
<td>
<a href="/admin/activate/{{$user.CN}}">
<a href="/admin/activate/{{ $user.GetAttributeValue "cn" }}">
{{$user.GetAttributeValue "cn"}}
</a>
</td>
<td>{{$user.GetAttributeValue "mail"}}</td>
<td>{{$user.GetAttributeValue "displayName"}}</td>
<td>{{$user.GetAttributeValue "givenName"}}</td>
<td>{{$user.GetAttributeValue "sn"}}</td>
<td>{{$user.GetAttributeValue "description"}}</td>
</tr>