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
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
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
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
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:
You need to edit this file MoinMoin/request/__init__.py and add "proxies_trusted"
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!
- Thanks! Uploaded the fixed version.
Fixed small bug with hostname resolution. Verified with 1.7.2 - works fine. -- AlexanderAgibalov 2008-11-01 08:12:07
Comments
Hi
- 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
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.
-- EricVeirasGalisson 2008-04-11 08:51:50
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 only workaround - is to change the code to work with 1.7. Unfortunately I haven't moved to this version, yet, so I'm not very familiar with changes. Hope to migrate by the end of the year. Maybe someone else can help here, like Boleslaw did with 1.6? -- AlexanderAgibalov 2008-09-09 05:44:04
Now under 1.8.1 the new error is "DataBrowserWidget instance has no attribute 'toHTML'" -- 84.163.33.56 2009-02-01 07:44:15. Is your migration in sight?
that should be easy to fix. IIRC toHTML was just renamed so that it is consistent with other code in moin. Just have a look in the src. -- ThomasWaldmann 2009-02-01 16:23:28
I am also getting the error in 1.8.3: "DataBrowserWidget instance has no attribute 'toHTML'". Does anyone know how to fix it? -- Gnarlodious 2024-11-23 01:07:10
use render
render = _format # Note: in moin <= 1.7.1 render() used request.write(), this was wrong! # Now it just returns the result, as the other widgets do.
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
- However the page_group_regex should be used. Do you have updated the groups defintition in 1.7.x as mentioned in docs/CHANGES?
I am using page_group_regex = ur'(?P<all>(?P<key>\S+)Group)' and updated all other page_*_regex to that format as well, as instructed in the example wikiconfig.py. -- MichaelDecker 2008-11-03 10:39:34
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