summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kmccarth@redhat.com>2007-08-28 09:20:12 -0700
committerKevin McCarthy <kmccarth@redhat.com>2007-08-28 09:20:12 -0700
commitef2dc5cefa2f9ba94edea7cfce8913e3f25723bd (patch)
tree1ebf9baee02663d9972e0bb19fd9dcbdfd267a42
parenteebaa73d3df425e309893d30f1f9dd6f43124439 (diff)
downloadfreeipa-ef2dc5cefa2f9ba94edea7cfce8913e3f25723bd.tar.gz
freeipa-ef2dc5cefa2f9ba94edea7cfce8913e3f25723bd.tar.xz
freeipa-ef2dc5cefa2f9ba94edea7cfce8913e3f25723bd.zip
Changes for larger data demo.
Add fields to search results Put result() call inside try block - it's throwing an exception Trap ADMINLIMIT and SIZELIMIT exceptions
-rw-r--r--ipa-server/ipa-gui/ipagui/controllers.py2
-rw-r--r--ipa-server/ipa-gui/ipagui/templates/userlist.kid28
-rw-r--r--ipa-server/ipaserver/ipaldap.py7
-rw-r--r--ipa-server/xmlrpc-server/funcs.py2
4 files changed, 33 insertions, 6 deletions
diff --git a/ipa-server/ipa-gui/ipagui/controllers.py b/ipa-server/ipa-gui/ipagui/controllers.py
index 7dff9c908..ca2d15a2d 100644
--- a/ipa-server/ipa-gui/ipagui/controllers.py
+++ b/ipa-server/ipa-gui/ipagui/controllers.py
@@ -145,7 +145,7 @@ class Root(controllers.RootController):
try:
users = client.find_users(uid.encode('utf-8'))
except ipaerror.IPAError, e:
- turbogears.flash("User show failed: " + str(e))
+ turbogears.flash("User list failed: " + str(e))
raise turbogears.redirect("/userlist")
return dict(users=users, fields=forms.user.UserFields())
diff --git a/ipa-server/ipa-gui/ipagui/templates/userlist.kid b/ipa-server/ipa-gui/ipagui/templates/userlist.kid
index df3e247e4..1b4a1201a 100644
--- a/ipa-server/ipa-gui/ipagui/templates/userlist.kid
+++ b/ipa-server/ipa-gui/ipagui/templates/userlist.kid
@@ -15,7 +15,7 @@
</div>
<div py:if='users != None'>
<h2>Results</h2>
- <table py:if='len(users) > 0'>
+ <table py:if='len(users) > 0' border="1">
<tr>
<th>
<label class="fieldlabel" py:content="fields.uid.label" />
@@ -23,13 +23,37 @@
<th>
Name
</th>
+ <th>
+ Phone
+ </th>
+ <th>
+ Unit
+ </th>
+ <th>
+ Title
+ </th>
+ <th>
+ License Plate
+ </th>
</tr>
<tr py:for="user in users">
<td>
<a href="${tg.url('/usershow',uid=user.uid)}">${user.uid}</a>
</td>
<td>
- ${user.cn}
+ ${user.givenName} ${user.sn}
+ </td>
+ <td>
+ ${user.telephoneNumber}
+ </td>
+ <td>
+ ${user.ou}
+ </td>
+ <td>
+ ${user.title}
+ </td>
+ <td>
+ ${user.carLicense}
</td>
</tr>
</table>
diff --git a/ipa-server/ipaserver/ipaldap.py b/ipa-server/ipaserver/ipaldap.py
index 188d9be53..f626f2f3a 100644
--- a/ipa-server/ipaserver/ipaldap.py
+++ b/ipa-server/ipaserver/ipaldap.py
@@ -260,12 +260,12 @@ class IPAdmin(SimpleLDAPObject):
try:
res = self.search(*args)
+ type, obj = self.result(res)
# res = self.search_ext(args[0], args[1], filterstr=args[2], attrlist=args[3], serverctrls=sctrl)
except ldap.LDAPError, e:
raise ipaerror.gen_exception(ipaerror.LDAP_DATABASE_ERROR, None, e)
- type, obj = self.result(res)
if not obj:
raise ipaerror.gen_exception(ipaerror.LDAP_NOT_FOUND,
"no such entry for " + str(args))
@@ -283,10 +283,13 @@ class IPAdmin(SimpleLDAPObject):
try:
res = self.search(*args)
+ type, obj = self.result(res)
+ except (ldap.ADMINLIMIT_EXCEEDED, ldap.SIZELIMIT_EXCEEDED), e:
+ raise ipaerror.gen_exception(ipaerror.LDAP_DATABASE_ERROR,
+ "Too many results returned by search", e)
except ldap.LDAPError, e:
raise ipaerror.gen_exception(ipaerror.LDAP_DATABASE_ERROR, None, e)
- type, obj = self.result(res)
if not obj:
raise ipaerror.gen_exception(ipaerror.LDAP_NOT_FOUND,
"no such entry for " + str(args))
diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py
index 0a8952b05..a0af41d42 100644
--- a/ipa-server/xmlrpc-server/funcs.py
+++ b/ipa-server/xmlrpc-server/funcs.py
@@ -385,7 +385,7 @@ class IPAServer:
# Assume the list of fields to search will come from a central
# configuration repository. A good format for that would be
# a comma-separated list of fields
- search_fields_conf_str = "uid,givenName,sn,telephoneNumber"
+ search_fields_conf_str = "uid,givenName,sn,telephoneNumber,ou,carLicense,title"
search_fields = string.split(search_fields_conf_str, ",")
criteria = self.__safe_filter(criteria)