1.1 --- a/MoinMessageSupport.py Sun Jul 21 22:40:31 2013 +0200
1.2 +++ b/MoinMessageSupport.py Sun Jul 21 22:41:55 2013 +0200
1.3 @@ -197,4 +197,36 @@
1.4
1.5 return getattr(request.cfg, "moinmessage_gpg_homedir")
1.6
1.7 +def get_signing_users(request):
1.8 +
1.9 + "Return a dictionary mapping usernames to signing keys."
1.10 +
1.11 + return getWikiDict(
1.12 + getattr(request.cfg, "moinmessage_gpg_signing_users_page", "MoinMessageSigningUserDict"),
1.13 + request)
1.14 +
1.15 +def get_recipients(request):
1.16 +
1.17 + """
1.18 + Return the recipients dictionary by first obtaining the page in which it
1.19 + is stored. This page may either be a subpage of the user's home page, if
1.20 + stored on this wiki, or it may be relative to the site root.
1.21 +
1.22 + The name of the subpage is defined by the configuration setting
1.23 + 'moinmessage_gpg_recipients_page', which if absent is set to
1.24 + "MoinMessageRecipientsDict".
1.25 + """
1.26 +
1.27 + subpage = getattr(request.cfg, "moinmessage_gpg_recipients_page", "MoinMessageRecipientsDict")
1.28 + homedetails = wikiutil.getInterwikiHomePage(request)
1.29 +
1.30 + if homedetails:
1.31 + homewiki, homepage = homedetails
1.32 + if homewiki == "Self":
1.33 + recipients = getWikiDict("%s/%s" % (homepage, subpage), request)
1.34 + if recipients:
1.35 + return recipients
1.36 +
1.37 + return getWikiDict(subpage, request)
1.38 +
1.39 # vim: tabstop=4 expandtab shiftwidth=4