Attachment 'attachfile.patch'
Download 1 * Allow all users from localhost to access the packaging system.
2 --- moin--main--1.5/MoinMoin/action/AttachFile.py 2005-12-29 20:52:25.244028800 +0100
3 +++ moin--local-branch--AlexanderSchremmer/MoinMoin/action/AttachFile.py 2005-12-30 00:18:03.225174400 +0100
4 @@ -258,7 +258,7 @@
5 viewlink = '<a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&do=view&target=%(urlfile)s">%(label_view)s</a>' % parmdict
6
7 if (packages.ZipPackage(request, os.path.join(attach_dir, file).encode(config.charset)).isPackage() and
8 - request.user.name in request.cfg.superuser):
9 + (request.user.name in request.cfg.superuser or request.remote_addr == "127.0.0.1")):
10 viewlink += ' | <a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&do=install&target=%(urlfile)s">%(label_install)s</a>' % parmdict
11 elif (zipfile.is_zipfile(os.path.join(attach_dir,file).encode(config.charset)) and
12 request.user.may.read(pagename) and request.user.may.delete(pagename)
13 @@ -479,7 +479,7 @@
14 else:
15 msg = _('You are not allowed to unzip attachments of this page.')
16 elif request.form['do'][0] == 'install':
17 - if request.user.name in request.cfg.superuser:
18 + if request.user.name in request.cfg.superuser or request.remote_addr == "127.0.0.1":
19 install_package(pagename, request)
20 else:
21 msg = _('You are not allowed to install files.')
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.