changeset 1893:d367d585c837

merged main
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 18 Mar 2007 16:40:16 +0100
parents dc1c3ca94cf8 (current diff) 76040d9ab344 (diff)
children 5ae7a098f6e4
files
diffstat 4 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Sun Mar 18 16:39:30 2007 +0100
+++ b/MoinMoin/action/AttachFile.py	Sun Mar 18 16:40:16 2007 +0100
@@ -631,6 +631,8 @@
     # can't access the client filename
     if rename:
         target = rename
+        # clear rename its only once wanted
+        request.form['rename'][0] = u''
     elif filename:
         target = filename
     else:
--- a/MoinMoin/action/SyncPages.py	Sun Mar 18 16:39:30 2007 +0100
+++ b/MoinMoin/action/SyncPages.py	Sun Mar 18 16:40:16 2007 +0100
@@ -306,7 +306,7 @@
 
                 if matching_tags:
                     newest_tag = matching_tags[-1]
-    
+
                     local_change = newest_tag.current_rev != sp.local_rev
                     remote_change = newest_tag.remote_rev != sp.remote_rev
 
@@ -468,10 +468,17 @@
                 else:
                     very_current_remote_rev = current_remote_rev
 
+
                 if local_change_done:
                     self.remove_rollback(rollback_local_change)
 
-                tags.add(remote_wiki=remote_full_iwid, remote_rev=very_current_remote_rev, current_rev=new_local_rev, direction=direction, normalised_name=sp.name)
+                # this is needed at least for direction both and cgi sync to standalone for immutable pages on both
+                # servers. It is not needed for the opposite direction
+                try:
+                    tags.add(remote_wiki=remote_full_iwid, remote_rev=very_current_remote_rev, current_rev=new_local_rev, direction=direction, normalised_name=sp.name)
+                except:
+                    self.log_status(ActionClass.ERROR, _("The page %s could not be merged because you are not allowed to modify the page in the remote wiki."), (sp.name, ))
+                    return
 
                 if sp.local_mime_type != MIMETYPE_MOIN or not wikiutil.containsConflictMarker(merged_text):
                     self.log_status(ActionClass.INFO, _("Page %s successfully merged."), (sp.name, ))
--- a/MoinMoin/action/login.py	Sun Mar 18 16:39:30 2007 +0100
+++ b/MoinMoin/action/login.py	Sun Mar 18 16:40:16 2007 +0100
@@ -42,10 +42,12 @@
 Name may contain any Unicode alpha numeric character, with optional one
 space between words. Group page name is not allowed.""") % name
 
+            # we do NOT check this, we don't want to disclose whether a user
+            # exists or not to not help an attacker.
             # Check that user exists
-            elif not user.getUserId(request, name):
-                error = _('Unknown user name: {{{"%s"}}}. Please enter'
-                             ' user name and password.') % name
+            #elif not user.getUserId(request, name):
+            #    error = _('Unknown user name: {{{"%s"}}}. Please enter'
+            #                 ' user name and password.') % name
 
             # Require password
             else:
--- a/MoinMoin/formatter/__init__.py	Sun Mar 18 16:39:30 2007 +0100
+++ b/MoinMoin/formatter/__init__.py	Sun Mar 18 16:40:16 2007 +0100
@@ -130,7 +130,7 @@
                 # Try to decode text. It might return junk, but we don't
                 # have enough information with attachments.
                 content = wikiutil.decodeUnknownInput(content)
-                colorizer = Parser(content, self.request)
+                colorizer = Parser(content, self.request, filename=filename)
                 colorizer.format(self)
             except IOError:
                 pass