changeset 459:39e0f08c0906

action=raw: move revision detection / acl check back to wikiaction imported from: moin--main--1.5--patch-463
author Thomas Waldmann <tw@waldmann-edv.de>
date Mon, 27 Feb 2006 06:44:33 +0000
parents 4110fdc3c1ff
children ab5ef616b0d8
files ChangeLog MoinMoin/Page.py MoinMoin/wikiaction.py
diffstat 3 files changed, 37 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Feb 26 23:55:12 2006 +0000
+++ b/ChangeLog	Mon Feb 27 06:44:33 2006 +0000
@@ -2,6 +2,20 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-02-27 07:44:33 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-463
+
+    Summary:
+      action=raw: move revision detection / acl check back to wikiaction
+    Revision:
+      moin--main--1.5--patch-463
+
+    action=raw: move revision detection / acl check back to wikiaction
+    
+
+    modified files:
+     ChangeLog MoinMoin/Page.py MoinMoin/wikiaction.py
+
+
 2006-02-27 00:55:12 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-462
 
     Summary:
--- a/MoinMoin/Page.py	Sun Feb 26 23:55:12 2006 +0000
+++ b/MoinMoin/Page.py	Mon Feb 27 06:44:33 2006 +0000
@@ -945,30 +945,10 @@
 
     def send_raw(self):
         """ Output the raw page data (action=raw) """
-        request = self.request
-        pagename = self.page_name
-        if not request.user.may.read(pagename):
-            Page(request, pagename).send_page(request)
-            return
-
-        request.http_headers(["Content-type: text/plain;charset=%s" % config.charset])
-
-        if request.form.has_key('rev'):
-            try:
-                rev = request.form['rev'][0]
-                try:
-                    rev = int(rev)
-                except StandardError:
-                    rev = 0
-            except KeyError:
-                rev = 0
-            page = Page(request, pagename, rev=rev)
-        else:
-            page = Page(request, pagename)
-
-        text = page.get_raw_body()
-        text = page.encodeTextMimeType(text)
-        request.write(text)
+        self.request.http_headers(["Content-type: text/plain;charset=%s" % config.charset])
+        text = self.get_raw_body()
+        text = self.encodeTextMimeType(text)
+        self.request.write(text)
         raise MoinMoinNoFooter
 
 
--- a/MoinMoin/wikiaction.py	Sun Feb 26 23:55:12 2006 +0000
+++ b/MoinMoin/wikiaction.py	Mon Feb 27 06:44:33 2006 +0000
@@ -771,7 +771,25 @@
 #############################################################################
 
 def do_raw(pagename, request):
-    Page(request, pagename).send_raw()
+    if not request.user.may.read(pagename):
+        Page(request, pagename).send_page(request)
+        return
+
+    if request.form.has_key('rev'):
+        try:
+            rev = request.form['rev'][0]
+            try:
+                rev = int(rev)
+            except StandardError:
+                rev = 0
+        except KeyError:
+            rev = 0
+        page = Page(request, pagename, rev=rev)
+    else:
+        page = Page(request, pagename)
+
+    page.send_raw()
+
 
 def do_format(pagename, request):
     # get the MIME type