changeset 1899:55617b3b1ac9

merged main
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 18 Mar 2007 23:07:43 +0100
parents b5e94fec8669 (current diff) 3d2dbe3e8a4c (diff)
children 86819d96cb01 6628902acfe7
files
diffstat 3 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Sun Mar 18 23:06:11 2007 +0100
+++ b/MoinMoin/PageEditor.py	Sun Mar 18 23:07:43 2007 +0100
@@ -498,6 +498,9 @@
         if not newpagename:
             return False, _("You can't copy to an empty pagename.")
 
+        if not self.request.user.may.write(newpagename):
+            return False, _('You are not allowed to copy this page!')
+    
         newpage = PageEditor(request, newpagename)
 
         pageexists_error = _("""'''A page with the name {{{'%s'}}} already exists.'''
@@ -996,12 +999,6 @@
             f.write(revstr+'\n')
             f.close()
 
-            # we need to update request.rev here to get the right revision used for
-            # action links rendered by the final send_page() call (#preview display)
-            # XXX this is not the right place to do this as you could use this function
-            # to save any other page than the currently displayed one
-            #request.rev = rev
-
             if not deleted:
                 # save to page file
                 pagefile = os.path.join(revdir, revstr)
--- a/MoinMoin/action/edit.py	Sun Mar 18 23:06:11 2007 +0100
+++ b/MoinMoin/action/edit.py	Sun Mar 18 23:07:43 2007 +0100
@@ -171,5 +171,7 @@
         if backto:
             pg = Page(request, backto)
 
+        # sets revision number to default for further actions
+        request.rev = 0
         pg.send_page(msg=savemsg)
 
--- a/MoinMoin/theme/__init__.py	Sun Mar 18 23:06:11 2007 +0100
+++ b/MoinMoin/theme/__init__.py	Sun Mar 18 23:07:43 2007 +0100
@@ -670,7 +670,7 @@
             # TODO: on new action, page info will not show.
             # A better solution will be if the action itself answer the question: showPageInfo().
             contentActions = [u'', u'show', u'refresh', u'preview', u'diff',
-                              u'subscribe', u'RenamePage', u'DeletePage',
+                              u'subscribe', u'RenamePage', u'CopyPage', u'DeletePage',
                               u'SpellCheck', u'print']
             return self.request.action in contentActions
         return False