changeset 128:eeee3b6cd853

text_x_arnica: checks target_page, exists, may.read
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 29 Jun 2008 10:06:53 +0200
parents 6f578becaf71
children ed4b7f8ea143
files data/plugin/parser/text_x_arnica.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Sun Jun 29 09:39:18 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Sun Jun 29 10:06:53 2008 +0200
@@ -464,7 +464,7 @@
         # we need to take the page_name from the formatter.page otherwise
         # include does not work
         self.pagename = formatter.page.page_name
-        if self.target_page:
+        if self.target_page and Page(self.request, self.target_page).exists() and self.request.user.may.read(self.target_page):
             self.pagename = self.target_page
         path = AttachFile.getAttachDir(self.request, self.pagename, create=1)
         image_dict = {}
@@ -562,7 +562,7 @@
         if not self.init_settings:
             return
 
-        if self.target_page and (not self.request.user.may.read(self.target_page) or not Page(self.request, self.target_page).exists()):
+        if self.target_page and (not Page(self.request, self.target_page).exists() or not self.request.user.may.read(self.target_page)):
             self.request.write(_("Page %(pagename)s does not exists or you don't have enough rights." % {"pagename": self.target_page}))
             return