summaryrefslogtreecommitdiffstats
path: root/idp/extra/modules/identities_ui.ptl
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@0d.be>2008-01-20 12:48:07 (GMT)
committerFrederic Peters <fpeters@0d.be>2008-01-20 12:48:07 (GMT)
commit62d602d98b5ba4f2eae5e8d66245ac5224509419 (patch)
tree3c955177130e132e9393c23cb132b6f3d135976a /idp/extra/modules/identities_ui.ptl
parent8d7b83946c4f09046ea02680fae29f7af425f138 (diff)
downloadpratic-62d602d98b5ba4f2eae5e8d66245ac5224509419.zip
pratic-62d602d98b5ba4f2eae5e8d66245ac5224509419.tar.gz
pratic-62d602d98b5ba4f2eae5e8d66245ac5224509419.tar.bz2
moved collectivity handling to objects
Diffstat (limited to 'idp/extra/modules/identities_ui.ptl')
-rw-r--r--idp/extra/modules/identities_ui.ptl23
1 files changed, 9 insertions, 14 deletions
diff --git a/idp/extra/modules/identities_ui.ptl b/idp/extra/modules/identities_ui.ptl
index 6728550..fb74dc2 100644
--- a/idp/extra/modules/identities_ui.ptl
+++ b/idp/extra/modules/identities_ui.ptl
@@ -142,10 +142,9 @@ class IdentitiesDirectory(Directory):
collectivity = None
- def __init__(self, collectivity = None, collectivity_name = None):
+ def __init__(self, collectivity = None):
Directory.__init__(self)
self.collectivity = collectivity
- self.collectivity_name = collectivity_name
def _q_traverse(self, path):
if not self.collectivity:
@@ -153,8 +152,6 @@ class IdentitiesDirectory(Directory):
user = get_session().get_user_object()
if not user.is_admin():
self.collectivity = user.get_collectivity()
- if self.collectivity and self.collectivity_name:
- self.collectivity_name = directory.get_collectivity_name(self.collectivity)
return Directory._q_traverse(self, path)
def _q_index [html] (self):
@@ -164,15 +161,14 @@ class IdentitiesDirectory(Directory):
if user.is_admin() and not self.collectivity:
# list all collectivities
'<ul>'
- for collectivity in directory.get_collectivities():
- ou = collectivity[0][3:collectivity[0].index(str(','))]
- '<li><a href="%s/">' % ou
- collectivity[1]
+ for collectivity in directory.get_sorted_collectivities():
+ '<li><a href="%s/">' % collectivity.ou
+ collectivity.cn
'</a></li>'
'</ul>'
else:
'<h2>'
- self.collectivity_name
+ self.collectivity.cn
'</h2>'
'<p>'
@@ -227,11 +223,10 @@ class IdentitiesDirectory(Directory):
def _q_lookup(self, component):
if not self.collectivity:
- for collectivity in directory.get_collectivities():
- if collectivity[0].startswith('ou=%s,' % component):
- collectivity_name = directory.get_collectivity_name(collectivity[0])
- get_response().breadcrumb.append((component + '/', collectivity_name))
- return IdentitiesDirectory(collectivity[0], collectivity_name)
+ for collectivity in directory.get_sorted_collectivities():
+ if collectivity.ou == component:
+ get_response().breadcrumb.append((component + '/', collectivity.cn))
+ return IdentitiesDirectory(collectivity)
else:
# lookup for agent
try: