mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-08-10 04:58:03 -05:00
Add update user to gui.
Fix fields to be lowercase in web gui (server now returns them lowercase). Fix ipaclient.py to refer to lowercase fields when adding a user. Fix user.getValue() to check isinstance(value,list) instead of value[0].
This commit is contained in:
@@ -59,18 +59,18 @@ class IPAClient:
|
||||
|
||||
# FIXME: This should be dynamic and can include just about anything
|
||||
# Let us add in some missing attributes
|
||||
if user.get('homeDirectory') is None:
|
||||
user['homeDirectory'] ='/home/%s' % user['uid']
|
||||
if user.get('homedirectory') is None:
|
||||
user['homedirectory'] ='/home/%s' % user['uid']
|
||||
if user.get('gecos') is None:
|
||||
user['gecos'] = user['uid']
|
||||
|
||||
# FIXME: This can be removed once the DS plugin is installed
|
||||
user['uidNumber'] ='501'
|
||||
user['uidnumber'] ='501'
|
||||
|
||||
# FIXME: What is the default group for users?
|
||||
user['gidNumber'] ='501'
|
||||
user['krbPrincipalName'] = "%s@%s" % (user['uid'], realm)
|
||||
user['cn'] = "%s %s" % (user['givenName'], user['sn'])
|
||||
user['gidnumber'] ='501'
|
||||
user['krbprincipalname'] = "%s@%s" % (user['uid'], realm)
|
||||
user['cn'] = "%s %s" % (user['givenname'], user['sn'])
|
||||
if user.get('gn'):
|
||||
del user['gn']
|
||||
|
||||
|
||||
+1
-3
@@ -58,9 +58,7 @@ class User:
|
||||
def getValue(self,name):
|
||||
"""Get the first value for the attribute named name"""
|
||||
value = self.data.get(name,[None])
|
||||
if (len(value) < 1):
|
||||
return value
|
||||
if isinstance(value[0],list) or isinstance(value[0],tuple):
|
||||
if isinstance(value,list) or isinstance(value,tuple):
|
||||
return value[0]
|
||||
else:
|
||||
return value
|
||||
|
||||
Reference in New Issue
Block a user