changeset 2875:19aef8a04be6

userform.admin: list of acl groups added
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 26 Sep 2007 16:58:38 +0200
parents de20fd4e2352
children 834ce71dddb3
files MoinMoin/userform/admin.py
diffstat 1 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/userform/admin.py	Wed Sep 26 16:57:17 2007 +0200
+++ b/MoinMoin/userform/admin.py	Wed Sep 26 16:58:38 2007 +0200
@@ -4,9 +4,10 @@
 
     @copyright: 2001-2004 Juergen Hermann <jh@web.de>,
                 2003-2007 MoinMoin:ThomasWaldmann
+                2007 MoinMoin:ReimarBauer
     @license: GNU GPL, see COPYING for details.
 """
-from MoinMoin import user
+from MoinMoin import user, wikidicts
 from MoinMoin.util.dataset import TupleDataset, Column
 from MoinMoin.Page import Page
 
@@ -19,14 +20,25 @@
     data.columns = [
         #Column('id', label=('ID'), align='right'),
         Column('name', label=('Username')),
+        Column('acl groups', label=('ACL Groups')),
         Column('email', label=('Email')),
         Column('jabber', label=('Jabber')),
         Column('action', label=_('Action')),
     ]
 
+    isgroup = request.cfg.cache.page_group_regex.search
+    grouppages = 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)
 
         userhomepage = Page(request, account.name)
         if userhomepage.exists():
@@ -39,14 +51,16 @@
             # 0
             request.formatter.rawHTML(namelink),
             # 1
+            request.formatter.rawHTML(list_groups),
+            # 2
             (request.formatter.url(1, 'mailto:' + account.email, css='mailto', do_escape=0) +
              request.formatter.text(account.email) +
              request.formatter.url(0)),
-            # 2
+            # 3
             (request.formatter.url(1, 'xmpp:' + account.jid, css='mailto', do_escape=0) +
              request.formatter.text(account.jid) +
              request.formatter.url(0)),
-            # 3
+            # 4
             (request.page.link_to(request, text=_('Mail account data'),
                                  querystr={"action": "recoverpass",
                                            "email": account.email,