summaryrefslogtreecommitdiff
path: root/Mailman/HTMLFormatter.py
diff options
context:
space:
mode:
authorklm1998-03-30 04:22:14 +0000
committerklm1998-03-30 04:22:14 +0000
commite6abf948be4bd77eb8739cc30f2b6fe26d597625 (patch)
tree5e62c40b94a8d0eaf77a4dbc8a66dd6f5911579e /Mailman/HTMLFormatter.py
parent16884960cdad9462c7d239248e647a09b06a4317 (diff)
downloadmailman-e6abf948be4bd77eb8739cc30f2b6fe26d597625.tar.gz
mailman-e6abf948be4bd77eb8739cc30f2b6fe26d597625.tar.zst
mailman-e6abf948be4bd77eb8739cc30f2b6fe26d597625.zip
Revised subscription list presentation so it is on a separate page.
The listinfo page now presents a button to get there, and authentication blanks when the list has a private roster of subscribers. This entailed several changes in mm_html, including new methods: - .FormatEditingOption() - Bound to a form replacement to provide the html for the options editing text. Conditionalized to mention the ability to get to user options editing via the subscriber's roster, depending on list privacy options. - .FormatRosterOptionForUser() - Another routine called via text replacements, inserts the text for visiting the roster according to list privacy settings. One nice side effect is that now private list members *can* see the list membership over the web, via entering their authentication info. (Only the admin can see the members of an anonymous list, but they can do that via the web form.)
Diffstat (limited to 'Mailman/HTMLFormatter.py')
-rw-r--r--Mailman/HTMLFormatter.py66
1 files changed, 64 insertions, 2 deletions
diff --git a/Mailman/HTMLFormatter.py b/Mailman/HTMLFormatter.py
index 8d684ea28..724197605 100644
--- a/Mailman/HTMLFormatter.py
+++ b/Mailman/HTMLFormatter.py
@@ -41,8 +41,6 @@ class HTMLFormatter:
def NotHidden(x, s=self, v=mm_cfg.ConcealSubscription):
return not s.GetUserOption(x, v)
- if self.private_roster:
- return 'Sorry, not available over the web.'
if digest:
people = filter(NotHidden, self.digest_members)
num_concealed = len(self.digest_members) - len(people)
@@ -151,6 +149,70 @@ class HTMLFormatter:
checked = ' CHECKED'
return '<input type=radio name="plain" value="1"%s>' % checked
+ def FormatEditingOption(self):
+ "Present editing options, according to list privacy."
+
+ text = ("<b>%s subscribers</b>, to edit your subscription options"
+ % self.real_name)
+ text = text + " %senter your email address: "
+
+ if self.private_roster == 0:
+ text = text % "<b><i>either</i></b> "
+ else:
+ text = text % ""
+ text = (text
+ + "<ul>"
+ + htmlformat.TextBox('info', size=40).Format()
+ + " "
+ + htmlformat.SubmitButton('UserOptions',
+ 'Edit Options').Format()
+ + "</ul>")
+ if self.private_roster == 0:
+ text = text + ("<p><b><i>or</i></b> visit the subscribers list"
+ ' (<a href="#subscribers">above</a>) and select'
+ " your entry.")
+ return text
+
+ def FormatRosterOptionForAdmin(self):
+ return "Admin subscriber roster would require admin password."
+ def FormatRosterOptionForUser(self):
+ "Provide avenue to subscribers roster, contingent to .private_roster."
+ text = ""
+ if not self.private_roster:
+ text = (text +
+ "Click here for the roster of "
+ + self.real_name
+ + " subscribers: "
+ + htmlformat.SubmitButton('SubscriberRoster',
+ 'Visit Subscriber list'
+ ).Format())
+ else:
+ if self.private_roster == 1:
+ only = 'members'
+ whom = 'Member:'
+ else:
+ only = 'the list administrator'
+ whom = 'Admin:'
+ # Solicit the user and password.
+ text = (text +
+ ("The subscriber roster is only available to %s.<br>Enter"
+ % only)
+ + (" your %s address and password to visit the"
+ % string.lower(whom[:-1]))
+ + " subscriber's roster:"
+ " <br><ul> "
+ + whom
+ + " "
+ + self.FormatBox('roster-email')
+ + " Password: "
+ + self.FormatSecureBox('roster-pw')
+ + "<br>"
+ + htmlformat.SubmitButton('SubscriberRoster',
+ 'Visit Subscriber List'
+ ).Format()
+ + "</ul>")
+ return text
+
def FormatFormStart(self, name, extra=''):
base_url = self.GetScriptURL(name)
full_url = os.path.join(base_url, extra)