changeset 3585:fc32d580fe37

SystemAdmin user browser: fix names/labels, optimize group membership calculation, cosmetic fixes
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 12 May 2008 13:59:31 +0200
parents 5be4f4a8fa65
children 35366465d4fe
files MoinMoin/userform/admin.py
diffstat 1 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/userform/admin.py	Mon May 12 13:33:21 2008 +0200
+++ b/MoinMoin/userform/admin.py	Mon May 12 13:59:31 2008 +0200
@@ -19,25 +19,22 @@
     data = TupleDataset()
     data.columns = [
         Column('name', label=_('Username')),
-        Column('acl groups', label=_('ACL Groups')),
+        Column('groups', label=_('Member of Groups')),
         Column('email', label=_('Email')),
         Column('jabber', label=_('Jabber')),
         Column('action', label=_('Action')),
     ]
 
     isgroup = request.cfg.cache.page_group_regexact.search
-    grouppages = request.rootpage.getPageList(user='', filter=isgroup)
+    groupnames = request.rootpage.getPageList(user='', filter=isgroup)
 
     # Iterate over users
     for uid in user.getUserList(request):
         account = user.User(request, uid)
-        list_acl_pages = []
-        for pagename in grouppages:
-            members, groups = request.dicts.expand_group(pagename)
-            pagename_link = Page(request, pagename).link_to(request)
-            if account.name in members:
-                list_acl_pages.append(pagename_link)
-        list_groups = ', '.join(list_acl_pages)
+
+        grouppage_links = ', '.join([Page(request, groupname).link_to(request)
+                                     for groupname in groupnames
+                                     if request.dicts.has_member(groupname, account.name)])
 
         userhomepage = Page(request, account.name)
         if userhomepage.exists():
@@ -81,15 +78,15 @@
             email_link = ''
 
         if account.jid:
-            jabber_link =  (request.formatter.url(1, 'xmpp:' + account.jid, css='mailto') +
-                            request.formatter.text(account.jid) +
-                            request.formatter.url(0))
+            jabber_link = (request.formatter.url(1, 'xmpp:' + account.jid, css='mailto') +
+                           request.formatter.text(account.jid) +
+                           request.formatter.url(0))
         else:
             jabber_link = ''
 
         data.addRow((
             request.formatter.rawHTML(namelink),
-            request.formatter.rawHTML(list_groups),
+            request.formatter.rawHTML(grouppage_links),
             email_link,
             jabber_link,
             recoverpass_link + " - " + enable_disable_link