Attachment 'page.diff'
Download 1 --- page_old.py 2006-10-15 15:20:00.000000000 +0200
2 +++ page.py 2006-12-04 22:27:28.000000000 +0100
3 @@ -500,6 +500,24 @@
4 """
5 return self.exists(domain='standard', includeDeleted=includeDeleted)
6
7 + def isApprovedPage(self):
8 + """ Is this page approved for public viewing?
9 +
10 + @rtype: bool
11 + @return: true, if this page has been approved
12 + """
13 + approvedFile = os.path.join(self.getPagePath(), "approved")
14 + if os.path.isfile(approvedFile):
15 + approvedRevision = {}
16 + for line in open(approvedFile).readlines():
17 + tmp = line.split("\t")
18 + approvedRevision[tmp[0]] = tmp[1]
19 + currentRevision = "%08d" % self.get_real_rev()
20 + if currentRevision in approvedRevision:
21 + return True
22 + return False
23 +
24 +
25 def exists(self, rev=0, domain=None, includeDeleted=False):
26 """ Does this page exist?
27
28 @@ -1245,6 +1263,8 @@
29 formatter=self.formatter))
30 elif not request.user.may.read(self.page_name):
31 request.write("<strong>%s</strong><br>" % _("You are not allowed to view this page."))
32 + elif (not self.isApprovedPage()) and (request.user.valid == 0):
33 + request.write("<strong>%s</strong><br>" % _("Sorry. This page has not been approved yet for public access."))
34 else:
35 # parse the text and send the page content
36 self.send_page_content(request, Parser, body,
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.