changeset 3916:afa2deceede7

PageEditor: Predefined variable @EMAIL@ added. This inserts the obfuscated email address by the email macro. The HomepageTemplate can now be defined as == @USERNAME@ == Email: @EMAIL@
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 03 Aug 2008 13:44:31 +0200
parents b4bdfaaa79b0
children c1110b025133
files MoinMoin/PageEditor.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Sat Aug 02 22:43:13 2008 +0200
+++ b/MoinMoin/PageEditor.py	Sun Aug 03 13:44:31 2008 +0200
@@ -764,6 +764,7 @@
         request = self.request
         now = self._get_local_timestamp()
         u = request.user
+        obfuscate_email_address = u.email.replace('@', ' AT SPAMFREE ')[::-1].replace('.', ' TOD ', 1)[::-1]
         signature = u.signature()
         variables = {
             'PAGE': self.page_name,
@@ -773,6 +774,7 @@
             'USERNAME': signature,
             'USER': "-- %s" % signature,
             'SIG': "-- %s <<DateTime(%s)>>" % (signature, now),
+            'EMAIL': "<<MailTo(%s)>>" % (obfuscate_email_address)
         }
 
         if u.valid and u.name: