mirror of
https://github.com/moepman/bk-dss
synced 2024-12-22 08:04:27 +01:00
list: also display numberic uid
This commit is contained in:
parent
b643c6ca18
commit
e33150507d
4
dss.py
4
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())
|
||||
|
||||
|
||||
|
@ -7,13 +7,15 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<td>common name</td>
|
||||
<td>UID number</td>
|
||||
<td>distinguished name</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for cn, dn in accounts %}
|
||||
{% for cn, uin, dn in accounts %}
|
||||
<tr>
|
||||
<td>{{ cn }}</td>
|
||||
<td>{{ uin }}</td>
|
||||
<td>{{ dn }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
Loading…
Reference in New Issue
Block a user