Attachment 'AttachFile.patch'

Download

   1 diff -r b81376013df9 MoinMoin/action/AttachFile.py
   2 --- a/MoinMoin/action/AttachFile.py	Sat Jan 26 19:18:41 2008 +0100
   3 +++ b/MoinMoin/action/AttachFile.py	Mon Jan 28 10:32:52 2008 +0100
   4 @@ -361,11 +361,11 @@ def _build_filelist(request, pagename, s
   5                  viewlink = '<a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&amp;drawing=%(base)s">%(label_edit)s</a>' % parmdict
   6              else:
   7                  viewlink = '<a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&amp;do=view&amp;target=%(urlfile)s">%(label_view)s</a>' % parmdict
   8 -
   9 -            if (packages.ZipPackage(request, os.path.join(attach_dir, file).encode(config.charset)).isPackage() and
  10 -                 request.user.isSuperUser() and request.user.may.write(pagename)):
  11 +                
  12 +            is_package = packages.ZipPackage(request, os.path.join(attach_dir, file).encode(config.charset)).isPackage() 
  13 +            if is_package and request.user.isSuperUser() and request.user.may.write(pagename):
  14                  viewlink += ' | <a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&amp;do=install&amp;target=%(urlfile)s">%(label_install)s</a>' % parmdict
  15 -            elif (zipfile.is_zipfile(os.path.join(attach_dir, file).encode(config.charset)) and
  16 +            elif (zipfile.is_zipfile(os.path.join(attach_dir, file).encode(config.charset)) and not is_package and
  17                  mt.minor == 'zip' and request.user.may.read(pagename) and request.user.may.delete(pagename)
  18                  and request.user.may.write(pagename)):
  19                  viewlink += ' | <a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&amp;do=unzip&amp;target=%(urlfile)s">%(label_unzip)s</a>' % parmdict

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.
  • [get | view] (2008-01-28 10:23:18, 1.7 KB) [[attachment:AttachFile.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.