From e33150507d206b52f915061825b3dd13ff0d3fd9 Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Thu, 16 May 2019 16:13:05 +0200 Subject: [PATCH] list: also display numberic uid --- dss.py | 4 ++-- templates/list.html | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dss.py b/dss.py index abef5fe..f7197b9 100755 --- a/dss.py +++ b/dss.py @@ -168,8 +168,8 @@ def list_users(): l = ldap.initialize(app.config.get('LDAP_URI', 'ldaps://127.0.0.1')) l.simple_bind_s(rdb.hget(session['uuid'], 'user'), rdb.hget(session['uuid'], 'pswd')) - sr = l.search_s(app.config.get('LDAP_BASE'), ldap.SCOPE_SUBTREE, '(objectClass=posixAccount)', ['cn']) - accounts = [(attr['cn'][0].decode(errors='ignore'), dn) for dn, attr in sr] + sr = l.search_s(app.config.get('LDAP_BASE'), ldap.SCOPE_SUBTREE, '(objectClass=posixAccount)', ['cn', 'uidNumber']) + accounts = [(attr['cn'][0].decode(errors='ignore'), attr['uidNumber'][0].decode(errors='ignore'), dn) for dn, attr in sr] return render_template('list.html', accounts=accounts, nav=build_nav()) diff --git a/templates/list.html b/templates/list.html index f5c93b3..5e39ff0 100644 --- a/templates/list.html +++ b/templates/list.html @@ -7,13 +7,15 @@ common name + UID number distinguished name - {% for cn, dn in accounts %} + {% for cn, uin, dn in accounts %} {{ cn }} + {{ uin }} {{ dn }} {% endfor %}