show which groups you are member in

This commit is contained in:
Franzi 2021-12-21 11:12:34 +01:00
parent 1fd2c4e984
commit 72a8fb69fb
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -6,20 +6,30 @@
<tr> <tr>
<th scope="col">group name</th> <th scope="col">group name</th>
<th scope="col">group description</th> <th scope="col">group description</th>
<th scope="col">member?</th>
<th scope="col">member count</th> <th scope="col">member count</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for group in groups|sort %} {% for group in groups|sort %}
{% if CURRENT_USER.entry_dn in group["member"] or USER_IS_ADMIN %}
<tr> <tr>
<th scope="row">
{% if USER_IS_ADMIN %} {% if USER_IS_ADMIN %}
<th scope="row"><a href="{{ url_for("group_edit", ou=group["ou"]) }}">{{ group["ou"] }}</a></th> <a href="{{ url_for("group_edit", ou=group["ou"]) }}">{{ group["ou"] }}</a>
{% else %} {% else %}
<th scope="row">{{ group["ou"] }}</th> {{ group["ou"] }}
{% endif %}
</th>
<td>{{ group["description"]|e }}</td>
{% if CURRENT_USER.entry_dn in group["member"] %}
<td></td>
{% else %}
<td></td>
{% endif %} {% endif %}
<td>{{ group["description"] }}</td>
<td>{{ group["member"]|length }}</td> <td>{{ group["member"]|length }}</td>
</tr> </tr>
{% endif %}
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>