mirror of
https://github.com/moepman/bk-dss
synced 2024-12-22 13:54:26 +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 = 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'))
|
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'])
|
sr = l.search_s(app.config.get('LDAP_BASE'), ldap.SCOPE_SUBTREE, '(objectClass=posixAccount)', ['cn', 'uidNumber'])
|
||||||
accounts = [(attr['cn'][0].decode(errors='ignore'), dn) for dn, attr in sr]
|
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())
|
return render_template('list.html', accounts=accounts, nav=build_nav())
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,13 +7,15 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>common name</td>
|
<td>common name</td>
|
||||||
|
<td>UID number</td>
|
||||||
<td>distinguished name</td>
|
<td>distinguished name</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for cn, dn in accounts %}
|
{% for cn, uin, dn in accounts %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ cn }}</td>
|
<td>{{ cn }}</td>
|
||||||
|
<td>{{ uin }}</td>
|
||||||
<td>{{ dn }}</td>
|
<td>{{ dn }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user