diff --git a/lumi2/templates/usermanager/index.html b/lumi2/templates/usermanager/index.html
index 10914d4..76a671e 100644
--- a/lumi2/templates/usermanager/index.html
+++ b/lumi2/templates/usermanager/index.html
@@ -1,15 +1,21 @@
{% extends 'base.html' %}
{% block content %}
-
-
This site is still under construction.
+
+
This site is still under construction
+
With Lumi2 you can easily manage the users and user-groups on your LDAP server.
+ {% if g.is_authenticated %}
+
There are currently {{ user_count }} users and {{ group_count }} groups.
+ {% else %}
+
You are currently not logged in. Please log in to continue.
+ {% endif %}
{% endblock content %}
diff --git a/lumi2/usermanager.py b/lumi2/usermanager.py
index 9203a96..6bfc2c3 100644
--- a/lumi2/usermanager.py
+++ b/lumi2/usermanager.py
@@ -6,7 +6,7 @@ from tempfile import TemporaryFile
from json import loads, dumps, JSONDecodeError
from flask import (
- Blueprint, render_template, abort, request, flash, redirect, url_for, current_app
+ Blueprint, render_template, abort, request, flash, redirect, url_for, current_app, g
)
from PIL import Image, UnidentifiedImageError
from flask_wtf import FlaskForm
@@ -56,6 +56,21 @@ def _initialize_ldap_dit():
def index():
"""Home page view."""
+ if g.is_authenticated:
+ try:
+ conn = ldap.get_connection()
+ except Exception:
+ abort(500)
+
+ user_count = len(ldap.get_users(conn))
+ group_count = len(ldap.get_groups(conn))
+ conn.unbind()
+ return render_template(
+ 'usermanager/index.html',
+ user_count=user_count,
+ group_count=group_count
+ )
+
return render_template('usermanager/index.html')