summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipa-gui
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-05-13 11:56:40 -0400
committerRob Crittenden <rcritten@redhat.com>2008-05-13 11:57:56 -0400
commit152530931671f2b7d21304f773667d3be7cbbd8c (patch)
tree747bac84b3ca99ae630952ed69713785c67f9b4d /ipa-server/ipa-gui
parent37ab0fe406cd2c15bfba5f0b924d59c9b3647f04 (diff)
downloadfreeipa-152530931671f2b7d21304f773667d3be7cbbd8c.tar.gz
freeipa-152530931671f2b7d21304f773667d3be7cbbd8c.tar.xz
freeipa-152530931671f2b7d21304f773667d3be7cbbd8c.zip
The admin user doesn't have the inetorgperson objectclass so don't have a givenname attribute. The UI is currently hardcoded to require "first name" which renders the admin user uneditable via the UI.
This is a hack that will allow admin to be edited, assuming that one doesn't try to add a firstname field. 440548
Diffstat (limited to 'ipa-server/ipa-gui')
-rw-r--r--ipa-server/ipa-gui/ipagui/subcontrollers/user.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/ipa-server/ipa-gui/ipagui/subcontrollers/user.py b/ipa-server/ipa-gui/ipagui/subcontrollers/user.py
index 0a79fc794..9232f305e 100644
--- a/ipa-server/ipa-gui/ipagui/subcontrollers/user.py
+++ b/ipa-server/ipa-gui/ipagui/subcontrollers/user.py
@@ -413,6 +413,16 @@ class UserController(IPAController):
# later the update will not be processed
cherrypy.session['uid'] = user_dict.get('uid')
+ # Hack. The admin user doesn't have inetorgperson as an
+ # objectclass so don't require the givenName attribute if
+ # this objectclass doesn't exist in the record.
+ oc = [x.lower() for x in user_dict.get('objectclass')]
+ try:
+ p = oc.index('inetorgperson')
+ except ValueError:
+ # This entry doesn't have inetorgperson so don't require gn
+ user_edit_form.validator.fields.get('givenname').not_empty=False
+
return dict(form=user_edit_form, user=user_dict,
user_groups=user_groups_dicts)
except ipaerror.IPAError, e: