mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-13 08:52:01 -05:00
Display name as separate attributes instead of showing common name.
We allow one to individually set first and last name but we do not automatically update the common name so changes don't seem to happen. 451318
This commit is contained in:
1 parent
c7ee747ee5
commit
76bf420754
2 files changed
+17
-2
No files matched your search
@@ -93,7 +93,7 @@ def main():
|
||||
|
||||
client = ipaclient.IPAClient(verbose=options.verbose)
|
||||
if options.all is None:
|
||||
users = client.find_users(args[1], sattrs=['uid','cn','homeDirectory','loginshell'])
|
||||
users = client.find_users(args[1], sattrs=['uid','givenname','sn','homeDirectory','loginshell'])
|
||||
else:
|
||||
users = client.find_users(args[1], sattrs=None)
|
||||
|
||||
@@ -121,6 +121,18 @@ def main():
|
||||
for ent in users:
|
||||
attr = ent.attrList()
|
||||
attr.sort()
|
||||
|
||||
# Always have sn following givenname
|
||||
try:
|
||||
l = attr.index('givenname')
|
||||
try:
|
||||
attr.remove('sn')
|
||||
attr.insert(l+1, 'sn')
|
||||
except ValueError:
|
||||
pass
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
if options.notranslate:
|
||||
labels = {}
|
||||
for a in attr:
|
||||
|
||||
@@ -33,7 +33,10 @@ def select_user(counter, users):
|
||||
i = 1
|
||||
print "%s entries were found. Which one would you like to display?" % counter
|
||||
for ent in users:
|
||||
print "%s: %s (%s)" % (i, ent.getValues('cn'), ent.getValues('uid'))
|
||||
if (ent.getValues('givenname')) is not None:
|
||||
print "%s: %s %s (%s)" % (i, ent.getValues('givenname'), ent.getValues('sn'), ent.getValues('uid'))
|
||||
else:
|
||||
print "%s: %s (%s)" % (i, ent.getValues('sn'), ent.getValues('uid'))
|
||||
i += 1
|
||||
while True:
|
||||
resp = raw_input("Choose one: (1 - %s), 0 for all, q to quit: " % counter)
|
||||
|
||||
Reference in new issue
Block a user