changeset 5495:da4384535256

merged moin/1.8
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 05 Feb 2010 15:25:42 +0100
parents 07833d54f43d (current diff) 9241bdfaeb6d (diff)
children e61c46134fc8
files MoinMoin/PageEditor.py MoinMoin/logfile/editlog.py
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Fri Feb 05 09:36:55 2010 +0100
+++ b/MoinMoin/PageEditor.py	Fri Feb 05 15:25:42 2010 +0100
@@ -1294,7 +1294,7 @@
         """ Write new lock file. """
         self._deleteLockFile()
         try:
-            editlog.EditLog(self.request, filename=self._filename()).add(
+            editlog.EditLog(self.request, filename=self._filename(), force_ip=True).add(
                self.request, wikiutil.timestamp2version(self.now), 0, "LOCK", self.page_name)
         except IOError:
             pass
--- a/MoinMoin/logfile/editlog.py	Fri Feb 05 09:36:55 2010 +0100
+++ b/MoinMoin/logfile/editlog.py	Fri Feb 05 15:25:42 2010 +0100
@@ -163,12 +163,16 @@
         # of a confusing userid
         self.uid_override = kw.get('uid_override', None)
 
+        # force inclusion of ip address, even if config forbids it.
+        # this is needed so PageLock can work correctly for locks of anon editors.
+        self.force_ip = kw.get('force_ip', False)
+
     def add(self, request, mtime, rev, action, pagename, host=None, extra=u'', comment=u''):
         """ Generate (and add) a line to the edit-log.
 
         If `host` is None, it's read from request vars.
         """
-        if request.cfg.log_remote_addr:
+        if request.cfg.log_remote_addr or self.force_ip:
             if host is None:
                 host = request.remote_addr or ''