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.
  • [get | view] (2010-02-05 17:13:18, 2.6 KB) [[attachment:ApprovePage-191.py]]
  • [get | view] (2005-10-18 14:16:34, 2.8 KB) [[attachment:ApprovePage.py]]
  • [get | view] (2005-11-08 14:48:57, 2.9 KB) [[attachment:ApprovePage.py-20050811]]
  • [get | view] (2005-11-08 14:51:44, 2.9 KB) [[attachment:ApprovePage.py-20050811-2]]
  • [get | view] (2010-11-18 09:43:04, 7.1 KB) [[attachment:Page.diff-v193-18112010]]
  • [get | view] (2010-02-05 17:15:25, 78.1 KB) [[attachment:Page.py]]
  • [get | view] (2010-11-18 09:41:22, 79.2 KB) [[attachment:Page.py-v193-18112010]]
  • [get | view] (2010-02-05 17:15:58, 4.3 KB) [[attachment:Page.py.patch]]
  • [get | view] (2008-02-12 01:09:14, 4.3 KB) [[attachment:PageApproval.diff]]
  • [get | view] (2010-02-05 17:25:50, 21.4 KB) [[attachment:approval-history.png]]
  • [get | view] (2010-11-18 10:19:10, 2.4 KB) [[attachment:approvePage.py-v193-18112010]]
  • [get | view] (2006-12-04 21:40:20, 3.0 KB) [[attachment:approvepage2.py]]
  • [get | view] (2005-10-18 14:17:03, 4.5 KB) [[attachment:modern.py]]
  • [get | view] (2010-11-18 09:42:23, 3.8 KB) [[attachment:modern_iso.diff-v193-18112010]]
  • [get | view] (2005-11-08 14:48:07, 4.6 KB) [[attachment:modern_iso.py]]
  • [get | view] (2010-11-18 09:40:06, 6.2 KB) [[attachment:modern_iso.py-v193-18112010]]
  • [get | view] (2006-12-04 21:40:00, 4.9 KB) [[attachment:modern_iso2.py]]
  • [get | view] (2010-11-18 09:40:39, 15.0 KB) [[attachment:modernized_iso.py-v193-18112010]]
  • [get | view] (2006-12-04 21:40:39, 1.5 KB) [[attachment:page.diff]]
  • [get | view] (2010-11-18 10:10:42, 7.2 KB) [[attachment:rightsidebar_iso.py-v193-18112010]]
  • [get | view] (2010-02-05 17:13:56, 29.0 KB) [[attachment:solenoid_iso-191.py]]
  • [get | view] (2010-02-05 17:15:05, 1.4 KB) [[attachment:solenoid_iso-191.py.patch]]
 All files | Selected Files: delete move to page copy to page

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