ó
Yü½cc           @   sb   d  Z  d d l m Z d d l m Z d d l m Z d d l m Z d Z d „  Z d „  Z	 d	 S(
   s¥   
    confirm <confirmation-string>
        Confirm an action.  The confirmation-string is required and should be
        supplied by a mailback confirmation notice.
iÿÿÿÿ(   t   mm_cfg(   t   Errors(   t   Pending(   t   _i   c         C   s
   t  t ƒ S(   N(   R   t   __doc__(   t   mlist(    (    s;   /export/web/mailman/mailman/Mailman/Commands/cmd_confirm.pyt   gethelp!   s    c         C   s9  |  j  } t | ƒ d k rK |  j j t d ƒ ƒ |  j j t | ƒ ƒ t S| d } y | j | |  j ƒ } WnNt	 j
 k
 r¼ } t t j t j d ƒ d ƒ } |  j j t d ƒ ƒ nyt	 j k
 rå |  j j t d ƒ ƒ nPt	 j k
 r|  j j t d ƒ ƒ n't	 j k
 r7|  j j t d ƒ ƒ nþt	 j k
 rl| j ƒ  } |  j j t d	 ƒ ƒ nÉt	 j k
 r•|  j j t d
 ƒ ƒ n t	 j k
 r¾|  j j t d ƒ ƒ nwX| d t j k rÛ| j s÷| d t j k r| j rd |  _ n2| d t j k r| d t j k rT|  j j t d ƒ d t d ƒ d ƒ q•|  j j t d ƒ d t d ƒ d ƒ n |  j j t d ƒ ƒ d | } g  }	 x„ |  j D]y }
 yR |
 j ƒ  | k s |
 j ƒ  j  ƒ  j! d ƒ s |
 j ƒ  j  ƒ  j! d ƒ rw¯n  Wn t" k
 rn X|	 j |
 ƒ q¯W|	 |  _ t S(   Ni   s   Usage:i    g      à?s  Invalid confirmation string.  Note that confirmation strings expire
approximately %(days)s days after the initial request.  They also expire if
the request has already been handled in some way.  If your confirmation has
expired, please try to re-submit your original request or message.sC   Your request has been forwarded to the list moderator for approval.s   You are already subscribed.s]   You are not currently a member.  Have you already unsubscribed or changed
your email address?s•   You are currently banned from subscribing to this list.  If you think this
restriction is erroneous, please contact the list owners at
%(owneraddr)s.s~   You were not invited to this mailing list.  The invitation has been discarded,
and both list administrators have been alerted.s?   Bad approval password given.  Held message is still being held.s   Confirmation succeededs    (t   Approvet   )t   Discards   confirm s	   approved:s   approve:(#   R   t   lent   resultst   appendR   R   t   STOPt   ProcessConfirmationt   msgR   t   MMBadConfirmationt   intR    t   PENDING_REQUEST_LIFEt   dayst   MMNeedApprovalt   MMAlreadyAMembert   NotAMemberErrort   MembershipIsBannedt   GetOwnerEmailt   HostileSubscriptionErrort   MMBadPasswordErrorR   t   SUBSCRIPTIONt   send_welcome_msgt   UNSUBSCRIPTIONt   send_goodbye_msgt   respondt   HELD_MESSAGEt   APPROVEt   commandst   lstript   lowert
   startswitht   UnicodeError(   t   rest   argsR   t   cookieR   t   eR   t	   owneraddrt   matcht   unprocessedt   line(    (    s;   /export/web/mailman/mailman/Mailman/Commands/cmd_confirm.pyt   process&   sj    	
 	"	"

	N(
   R   t   MailmanR    R   R   t   Mailman.i18nR   R   R   R/   (    (    (    s;   /export/web/mailman/mailman/Mailman/Commands/cmd_confirm.pyt   <module>   s   	