summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/baseldap.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-04-22 13:43:30 -0400
committerAdam Young <ayoung@redhat.com>2011-04-22 14:49:20 -0400
commitd3b0c64fcec9a97626dbaca238a0186f180fe2fd (patch)
tree625b972b9945d89731ca7cb4a0c8b39dea08a39a /ipalib/plugins/baseldap.py
parentf746121824c58c1d21d94ae4f2afd8893be9e1dd (diff)
downloadfreeipa-d3b0c64fcec9a97626dbaca238a0186f180fe2fd.tar.gz
freeipa-d3b0c64fcec9a97626dbaca238a0186f180fe2fd.tar.xz
freeipa-d3b0c64fcec9a97626dbaca238a0186f180fe2fd.zip
Modify the default attributes shown in user-find to match the UI design.
This change means the UI can stop using the --all option and have to retrieve significantly less information from the server. It also speeds up user-find as it doesn't have to calculate membership. This adds a new baseclass parameter, search_display_attributes, which can provide a separate list from default_attributes just for find commands. The UI will need to be changed to switch from using cn to using givenname and sn. ticket 1136
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r--ipalib/plugins/baseldap.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 044e00e08..4b80c6d06 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -256,6 +256,7 @@ class LDAPObject(Object):
search_attributes = []
search_attributes_config = None
default_attributes = []
+ search_display_attributes = [] # attributes displayed in LDAPSearch
hidden_attributes = ['objectclass', 'aci']
# set rdn_attribute only if RDN attribute differs from primary key!
rdn_attribute = ''
@@ -1362,11 +1363,15 @@ class LDAPSearch(CallbackInterface, crud.Search):
search_kw = self.args_options_2_entry(**options)
+ if self.obj.search_display_attributes:
+ defattrs = self.obj.search_display_attributes
+ else:
+ defattrs = self.obj.default_attributes
if options.get('all', False):
- attrs_list = ['*'] + self.obj.default_attributes
+ attrs_list = ['*'] + defattrs
else:
attrs_list = list(
- set(self.obj.default_attributes + search_kw.keys())
+ set(defattrs + search_kw.keys())
)
if self.obj.search_attributes: