Commit 86dc29e3 authored by Jérome Perrin's avatar Jérome Perrin

Fix Base_download so that it can be used by non manager users

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16167 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ed547af3
...@@ -68,14 +68,17 @@ ...@@ -68,14 +68,17 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>request=context.REQUEST\n <value> <string>request = container.REQUEST\n
response = request.RESPONSE\n
\n
if hasattr(context,\'getContentType\'):\n if hasattr(context,\'getContentType\'):\n
request.RESPONSE.setHeader(\'Content-type\', context.getContentType())\n response.setHeader(\'Content-type\', context.getContentType())\n
else:\n else:\n
request.RESPONSE.setHeader(\'Content-type\', context.getFormat())\n response.RESPONSE.setHeader(\'Content-type\', context.getFormat())\n
file_name = context.getTitle() or context.getSourceReference()\n \n
request.RESPONSE.setHeader(\'Content-disposition\', \'attachment;; filename="%s"\' % file_name)\n file_name = context.getTitle() or context.getSourceReference() or context.getId()\n
return context.manage_FTPget()\n response.setHeader(\'Content-disposition\', \'attachment;; filename="%s"\' % file_name)\n
return context.index_html(request, response)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -119,9 +122,11 @@ return context.manage_FTPget()\n ...@@ -119,9 +122,11 @@ return context.manage_FTPget()\n
<value> <value>
<tuple> <tuple>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>container</string>
<string>request</string> <string>request</string>
<string>response</string>
<string>hasattr</string> <string>hasattr</string>
<string>context</string>
<string>file_name</string> <string>file_name</string>
</tuple> </tuple>
</value> </value>
......
448 449
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment