1.1 --- a/README.txt Sat Jun 08 01:21:27 2013 +0200
1.2 +++ b/README.txt Sat Jun 08 01:22:06 2013 +0200
1.3 @@ -10,8 +10,8 @@
1.4 Configuring GPG for a Wiki
1.5 --------------------------
1.6
1.7 -Initialise a homedir for GPG and configure it using ACL (access control list)
1.8 -properties:
1.9 +Initialise a homedir for GPG and configure it using filesystem ACL (access
1.10 +control list) properties:
1.11
1.12 ./scripts/init_wiki_keyring.sh WIKI WEBUSER
1.13
1.14 @@ -72,6 +72,9 @@
1.15
1.16 moinmessage_gpg_recipients_page (optional, default is MoinMessageRecipientsDict)
1.17 This provides a mapping from recipients to remote URLs and key fingerprints.
1.18 + Each user can define the named page as a subpage of their own home page.
1.19 + If no such personal mapping exists, a common mapping exists relative to the
1.20 + site root.
1.21
1.22 moinmessage_reject_messages_without_dates (optional, default is True)
1.23 This causes messages sent to a Wiki using the PostMessage action to be
2.1 --- a/actions/SendMessage.py Sat Jun 08 01:21:27 2013 +0200
2.2 +++ b/actions/SendMessage.py Sat Jun 08 01:22:06 2013 +0200
2.3 @@ -13,7 +13,8 @@
2.4 from MoinMoin import config
2.5 from MoinMessage import GPG, MoinMessageError, Message, sendMessage
2.6 from MoinSupport import *
2.7 -from MoinMoin.wikiutil import escape, MimeType, parseQueryString, taintfilename
2.8 +from MoinMoin.wikiutil import escape, MimeType, parseQueryString, \
2.9 + taintfilename, getInterwikiHomePage
2.10
2.11 from email.mime.image import MIMEImage
2.12 from email.mime.multipart import MIMEMultipart
2.13 @@ -253,9 +254,30 @@
2.14 return getattr(self.request.cfg, "moinmessage_gpg_homedir")
2.15
2.16 def get_recipients(self):
2.17 - return getWikiDict(
2.18 - getattr(self.request.cfg, "moinmessage_gpg_recipients_page", "MoinMessageRecipientsDict"),
2.19 - self.request)
2.20 +
2.21 + """
2.22 + Return the recipients dictionary by first obtaining the page in which it
2.23 + is stored. This page may either be a subpage of the user's home page, if
2.24 + stored on this wiki, or it may be relative to the site root.
2.25 +
2.26 + The name of the subpage is defined by the configuration setting
2.27 + 'moinmessage_gpg_recipients_page', which if absent is set to
2.28 + "MoinMessageRecipientsDict".
2.29 + """
2.30 +
2.31 + request = self.request
2.32 +
2.33 + subpage = getattr(request.cfg, "moinmessage_gpg_recipients_page", "MoinMessageRecipientsDict")
2.34 + homedetails = getInterwikiHomePage(request)
2.35 +
2.36 + if homedetails:
2.37 + homewiki, homepage = homedetails
2.38 + if homewiki == "Self":
2.39 + recipients = getWikiDict("%s/%s" % (homepage, subpage), request)
2.40 + if recipients:
2.41 + return recipients
2.42 +
2.43 + return getWikiDict(subpage, request)
2.44
2.45 def get_signing_users(self):
2.46 return getWikiDict(