From e6abf948be4bd77eb8739cc30f2b6fe26d597625 Mon Sep 17 00:00:00 2001 From: klm Date: Mon, 30 Mar 1998 04:22:14 +0000 Subject: 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.) --- modules/mm_html.py | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) (limited to 'modules/mm_html.py') diff --git a/modules/mm_html.py b/modules/mm_html.py index 8d684ea28..724197605 100644 --- a/modules/mm_html.py +++ b/modules/mm_html.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 '' % checked + def FormatEditingOption(self): + "Present editing options, according to list privacy." + + text = ("%s subscribers, to edit your subscription options" + % self.real_name) + text = text + " %senter your email address: " + + if self.private_roster == 0: + text = text % "either " + else: + text = text % "" + text = (text + + "") + if self.private_roster == 0: + text = text + ("

or visit the subscribers list" + ' (above) 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.
Enter" + % only) + + (" your %s address and password to visit the" + % string.lower(whom[:-1])) + + " subscriber's roster:" + "

") + return text + def FormatFormStart(self, name, extra=''): base_url = self.GetScriptURL(name) full_url = os.path.join(base_url, extra) -- cgit v1.2.3-70-g09d2