diff options
author | bwarsaw <> | 2003-11-21 02:52:04 +0000 |
---|---|---|
committer | bwarsaw <> | 2003-11-21 02:52:04 +0000 |
commit | cf697eb4ac20bea46dbdc86832fe128ef770deeb (patch) | |
tree | eb717b985c39c23e7d7fffb14dc7df0c22d5cfbd /Mailman | |
parent | 60389a4ebedf1a225105bb7b96569d4f28641da2 (diff) | |
download | mailman2-cf697eb4ac20bea46dbdc86832fe128ef770deeb.tar.gz mailman2-cf697eb4ac20bea46dbdc86832fe128ef770deeb.tar.xz mailman2-cf697eb4ac20bea46dbdc86832fe128ef770deeb.zip |
ApprovedAddMember(): Add a 'whence' argument which gets passed a
descriptive string explaining where the member got added from.
Improves subscription logging.
AddMember(): Pass 'remote' to ApprovedAddMember()'s whence argument.
ProcessConfirmation(): We know whether the confirmation came from
email or via the web, so pass this information to
ApprovedAddMember()'s whence argument.
Diffstat (limited to '')
-rw-r--r-- | Mailman/MailList.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py index 3b9f47b0..3122423e 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -807,7 +807,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, # means the user must confirm; 2 means the admin must approve; 3 means # the user must confirm and then the admin must approve if self.subscribe_policy == 0: - self.ApprovedAddMember(userdesc) + self.ApprovedAddMember(userdesc, whence=remote or '') elif self.subscribe_policy == 1 or self.subscribe_policy == 3: # User confirmation required. BAW: this should probably just # accept a userdesc instance. @@ -854,7 +854,8 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, raise Errors.MMNeedApproval, _( 'subscriptions to %(realname)s require moderator approval') - def ApprovedAddMember(self, userdesc, ack=None, admin_notif=None, text=''): + def ApprovedAddMember(self, userdesc, ack=None, admin_notif=None, text='', + whence=''): """Add a member right now. The member's subscription must be approved by what ever policy the @@ -903,8 +904,8 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, kind = ' (digest)' else: kind = '' - syslog('subscribe', '%s: new%s %s', self.internal_name(), - kind, formataddr((email, name))) + syslog('subscribe', '%s: new%s %s, %s', self.internal_name(), + kind, formataddr((email, name)), whence) if ack: self.SendSubscribeAck(email, self.getMemberPassword(email), digest, text) @@ -1072,6 +1073,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, except ValueError: raise Errors.MMBadConfirmation, 'op-less data %s' % (data,) if op == Pending.SUBSCRIPTION: + whence = 'via email confirmation' try: userdesc = data[0] # If confirmation comes from the web, context should be a @@ -1080,6 +1082,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, # context is a Message and isn't relevant, so ignore it. if isinstance(context, UserDesc): userdesc += context + whence = 'via web confirmation' addr = userdesc.address fullname = userdesc.fullname password = userdesc.password @@ -1104,7 +1107,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, name = self.real_name raise Errors.MMNeedApproval, _( 'subscriptions to %(name)s require administrator approval') - self.ApprovedAddMember(userdesc) + self.ApprovedAddMember(userdesc, whence=whence) return op, addr, password, digest, lang elif op == Pending.UNSUBSCRIPTION: addr = data[0] |