1.1 --- a/actions/ApproveChanges.py Mon Oct 10 22:28:58 2011 +0200
1.2 +++ b/actions/ApproveChanges.py Tue Oct 11 01:13:12 2011 +0200
1.3 @@ -38,7 +38,6 @@
1.4 d = {
1.5 "buttons_html" : buttons_html,
1.6 "prompt" : escape(_("Approve the displayed page version?")),
1.7 - "purge_label" : escape(_("Purge all other queued versions"))
1.8 }
1.9
1.10 # Prepare the output HTML.
1.11 @@ -46,16 +45,9 @@
1.12 html = '''
1.13 <table>
1.14 <tr>
1.15 - <td colspan="2">%(prompt)s</td>
1.16 + <td>%(prompt)s</td>
1.17 </tr>
1.18 <tr>
1.19 - <td class="label"><label>%(purge_label)s</label></td>
1.20 - <td>
1.21 - <input name="purge" type="checkbox" value="yes" />
1.22 - </td>
1.23 - </tr>
1.24 - <tr>
1.25 - <td></td>
1.26 <td class="buttons">
1.27 %(buttons_html)s
1.28 </td>
1.29 @@ -74,12 +66,8 @@
1.30 # Make sure that only suitably privileged users can perform this action.
1.31
1.32 queued_changes_page = get_queued_changes_page(request)
1.33 - reviewers_group = getattr(request.cfg, "reviewers_group", "PageReviewersGroup")
1.34
1.35 - if not request.user.valid or (
1.36 - not request.dicts.has_member(reviewers_group, request.user.name) and \
1.37 - not request.user.isSuperUser()):
1.38 -
1.39 + if not is_reviewer(request):
1.40 return 0, _("Only page reviewers can perform this action.")
1.41
1.42 # Edit the target page, using this page's content.
1.43 @@ -91,10 +79,19 @@
1.44 target_page_name = get_target_page_name(self.pagename)
1.45 target_page = PageEditor(request, target_page_name)
1.46
1.47 - # Save the target page.
1.48 + # Save the target page, first removing the signature and then removing
1.49 + # any protective ACL.
1.50 +
1.51 + body = self.page.get_raw_body()
1.52 +
1.53 + body = check_page(request, body)
1.54 + if not body:
1.55 + return 0, _("The queued changes have been modified somehow. Not saving!")
1.56 +
1.57 + body = remove_access_control(request, body)
1.58
1.59 try:
1.60 - target_page.saveText(self.page.get_raw_body(), 0)
1.61 + target_page.saveText(body, 0, comment=_("Changes to page approved."))
1.62 except PageEditor.Unchanged:
1.63 pass
1.64