Update of /cvsroot/mailman/mailman/Mailman
In directory sc8-pr-cvs1:/tmp/cvs-serv28477

Modified Files:
      Tag: Release_2_1-maint
        MailList.py 
Log Message:
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.


Index: MailList.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/MailList.py,v
retrieving revision 2.100.2.6
retrieving revision 2.100.2.7
diff -u -d -r2.100.2.6 -r2.100.2.7
--- MailList.py 10 Oct 2003 04:11:45 -0000      2.100.2.6
+++ MailList.py 21 Nov 2003 02:52:04 -0000      2.100.2.7
@@ -807,7 +807,7 @@
         # 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 @@
             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 @@
             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 @@
         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 @@
                 # 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 @@
                 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]



_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-checkins

Reply via email to