Set of tools for administration purposes

Most of these macros can be used only by SuperUsers.

Written by: AlexanderAgibalov

Converted to new syntax of 1.6 by: BoleslawKulbabinski

AllPagesWithACL

AllPagesWithACL.py

Last updated: 22 December 2007

List all pages in a Wiki, showing each page's ACL. Only read-permitted pages for the current user are shown.

usage: <<AllPagesWithACL()>>

LostSoulsInGroups

LostSoulsInGroups.py

Last updated: 22 December 2007

List all users who are mentioned in custom groups, but don't have user accounts. This means that these users either haven't registered yet (but have already been added to some group) or their accounts have been deleted or there's a misprint in their name in a group-file.

usage: <<LostSoulsInGroups()>>

ManageUsers

ManageUsers.py

Last updated: 22 December 2007

Admin tool for SuperUsers to view and delete user accounts. This is extention of a native SystemAdmin macro. See macro header for important information and installation instruction.

usage: <<ManageUsers()>>

WikiLog

WikiLog.py

Last updated: 01 November 2008

One more admin tool for SuperUsers to view which pages have been visited. Without arguments lists page visits for the last 30(31) days. Argument indicates starting date. Macros tries to resolve host names of visitors, otherwise IP is indicated.

usage: <<WikiLog()>> or <<WikiLog(yyyy, mm, dd)>>

Note: there have been reports that the localhost is displayed instead of IP when Wiki is behind an Apache httpd reverse proxy. Unfortunately I cannot do anything here because I'm taking IP from  wiki\data\event-log  which is update by the Wiki itself.

<!> I also got the same problem; solutions was like:

     10 # Support for remote IP address detection when using (reverse) proxy (or even proxies).
     11 # If you exactly KNOW which (reverse) proxies you can trust, put them into the list
     12 # below, so we can determine the "outside" IP as your trusted proxies see it.
     13
     14 #proxies_trusted = [] # trust noone!
     15 proxies_trusted = ['127.0.0.1', ] # can be a list of multiple IPs

<!> There is minor bug in this code! There is a missing colon (:) after the else on line 37!

{i} Fixed small bug with hostname resolution. Verified with 1.7.2 - works fine. -- AlexanderAgibalov 2008-11-01 08:12:07


Comments

Hi

  1. actually, AllPagesWithACL list ALL the pages on a Wiki instance, including pages that do not have any ACL (on the page i mean). I think it should be better to just include pages that do have some. Here is a little diff to apply to the current release to disabled listing of these pages with no ACL
    • Well, actually one of the reasons why I wrote that macro was to check where I might have forgotten to put ACL. However, with introduction of hierarchic ACLs in 1.6 this is no more a serious problem... -- AlexanderAgibalov 2008-04-16 08:14:26

39,40c39,41
<         html += "<tr><td>%s</td>" % pg
<         html += "<td>%s</td></tr>" % ac
---
>       if ac != "not defined":
>           html += "<tr><td>%s</td>" % pg
>           html += "<td>%s</td></tr>" % ac
  1. I think also it could be interesting to disable the listing of "system pages" (pages from the MoinMoin distribution) but currently I don't know how.

    I finally found how to do that, and here is a diff to implement this behaviour

34c34,35
<         all[Page(macro.request, pagename).link_to(macro.request)] = getAcl(macro.request, pagename)
---
>         if Page(macro.request,pagename).isStandardPage():
>           all[Page(macro.request, pagename).link_to(macro.request)] = getAcl(macro.request, pagename)

The "ManageUsers"-Macro stopped to work under 1.7.x becaus 'unknown action userform'. Is there any workaround? -- MelaEckenfels 2008-09-03 12:15:46

The LostSoulsInGroups Macro produces a little too much output for my understanding: It lists all the Groups that are defined in the Underlay, like SystemPagesInEnglishGroup for example. Also, it lists Pages that should not even be group-pages because they do not end on "Group" but only contain "Group" somewhere in between. (Example: HomepageGroupsTemplate). I have been looking into the code briefly and I guess there would have to be another filter on the returned list of grouppages to narrow it down a bit more. (I am using the Macro on 1.7 and did not test it on 1.6 before, so maybe the problem does not exist there, I don't know.) -- MichaelDecker 2008-10-01 15:29:30

First of all thanks for yours useful Macro „AllPagesWithACL“. I am using moinmoin1.8.2 and it is working fine with this version. I want to change this Macro little bit according to my need, maybe you can help me. I want to get pages according to Groups. I give one example.

I have 3 Groups. FranceGroup SupportGroup DevGroup

I want to see that which pages are readable and editable for FranceGroup. I mean that I want to get whole list of pages with acl in which I mentioned FranceGroup ACL (Not other pages For other groups). And then other list for SupportGroup and DevGroup. I want to do some filtering between pages.

Maybe I use this macro like <<<AllPagesWithACL(FranceGroup)>> , it will show me the list of pages with acl only for FranceGroup. And When I will call macro like that <<<AllPagesWithACL(SupportGroup)>> , then It gives me the list of pages, where I used the acl only for this Group. And when I will call like this <<<AllPagesWithACL()>> then It will me the the result of all those pages, where I did not defined the acls.

I have lot of pages therefore I need some filtering between pages. I will appreciate any kind of help.

Thanks a lot

MoinMoin: MacroMarket/1.6_AdminTools (last edited 2009-05-23 00:08:26 by ReimarBauer)