/usr/share/pyshared/MoinMoin/macro/SystemAdmin.py is in python-moinmoin 1.9.3-1ubuntu2.3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - System Administration
Web interface to do MoinMoin system administration tasks.
@copyright: 2001-2003 Juergen Hermann <jh@web.de>
@license: GNU GPL, see COPYING for details.
"""
from MoinMoin.userform import do_user_browser
from MoinMoin.action.AttachFile import do_admin_browser
Dependencies = ["time"]
def macro_SystemAdmin(macro):
_ = macro.request.getText
request = macro.request
# do not show system admin to users not in superuser list
if not request.user.isSuperUser():
return ''
_MENU = {
'attachments': (_("File attachment browser"), do_admin_browser),
'users': (_("User account browser"), do_user_browser),
}
choice = request.values.get('sysadm')
# create menu
menuitems = [(label, fnid) for fnid, (label, handler) in _MENU.items()]
menuitems.sort()
result = []
f = macro.formatter
for label, fnid in menuitems:
if fnid == choice:
result.append(f.strong(1))
result.append(f.text(label))
result.append(f.strong(0))
else:
#result.append(wikiutil.link_tag(request, "%s?sysadm=%s" % (macro.formatter.page.page_name, id), label))
result.append(f.page.link_to(request, label, querystr={'sysadm': fnid}))
result.append(f.linebreak())
result.append(f.linebreak())
# add chosen content
if choice in _MENU:
result.append(f.rawHTML(_MENU[choice][1](request)))
return ''.join(result)
|