added real names to admin user list combo

This commit is contained in:
smile 2013-11-12 21:28:00 +01:00
parent 2f7b13ac00
commit 8bf6c36bcb
2 changed files with 3 additions and 5 deletions

View file

@ -173,13 +173,11 @@ class MemberValues(object):
if (result_data == []):
break
else:
## here you don't have to append to a list
## you could do whatever you want with the individual entry
## The appending to list is just for illustration.
if result_type == ldap.RES_SEARCH_ENTRY:
result_set.append(result_data)
userlist = [x[0][1]['uid'][0] for x in result_set]
# list comprehension to get a list of user tupels in the format ("nickname", "nickname (real name)")
userlist = [(x[0][1]['uid'][0], '%s (%s)' % (x[0][1]['uid'][0], x[0][1]['cn'][0])) for x in result_set]
return sorted(userlist)
except:
return []