[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#683280: unblock: moin/1.9.4-5



On Mon, Jul 30, 2012 at 06:52:19PM +0100, Adam Barratt wrote:
>On Mon, 2012-07-30 at 13:53 +0100, Steve McIntyre wrote:
>> Please unblock package moin
>> 
>> Small changes to add extra features to help with anti-spam. Once it's
>> in testing I'll do a backport again so that we can get the new code
>> onto wiki.debian.org. Debdiff attached.
>
>Possibly a little picky (or misunderstanding), but:
>
>++            create_error = subprocess.check_output([request.cfg.external_creation_check,
>++                           theuser.name,
>++                           theuser.email,
>++                           theuser.account_creation_host])
>++            if create_error:
>++                request.theme.add_msg(_("Unable to send verification mail, %s. Account creation aborted." % create_error), "error")
>
>Isn't the error in this case that the account creation failed, rather
>than the sending of the mail?

Doh, correct. :-)

-6 is in incoming now. New debdiff attached.

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
< liw> everything I know about UK hotels I learned from "Fawlty Towers"
diff -Nru moin-1.9.4/debian/changelog moin-1.9.4/debian/changelog
--- moin-1.9.4/debian/changelog	2012-05-03 11:55:51.000000000 +0000
+++ moin-1.9.4/debian/changelog	2012-07-30 18:52:42.000000000 +0000
@@ -1,3 +1,18 @@
+moin (1.9.4-6) unstable; urgency=low
+
+  * Fix the error message displayed when external_creation_check fails
+
+ -- Steve McIntyre <93sam@debian.org>  Mon, 30 Jul 2012 19:52:39 +0100
+
+moin (1.9.4-5) unstable; urgency=low
+
+  * Store date and host when a new account is created
+  * Add the option to call an external helper program at account creation
+    time to help with local account control policy (e.g. anti-spam)
+  * Make sending of email verification messages slightly more verbose.
+
+ -- Steve McIntyre <93sam@debian.org>  Sun, 29 Jul 2012 11:40:28 +0100
+
 moin (1.9.4-4) unstable; urgency=low
 
   * Fix stupid typo in the mail verification patch. Closes: #671211
diff -Nru moin-1.9.4/debian/patches/mail-verification.patch moin-1.9.4/debian/patches/mail-verification.patch
--- moin-1.9.4/debian/patches/mail-verification.patch	2012-05-03 11:59:44.000000000 +0000
+++ moin-1.9.4/debian/patches/mail-verification.patch	2012-07-30 18:52:05.000000000 +0000
@@ -1,15 +1,16 @@
 Description: Add support for requiring new accounts to be verified by email
 Origin: http://moinmo.in/MoinMoinPatch/VerifyAccountCreationByEmail
 Author: Steve McIntyre
-Last-Update: 2012-04-29
+Last-Update: 2012-07-29
 
 --- a/MoinMoin/action/newaccount.py	2012-04-22 18:17:14.000000000 +0100
 +++ b/MoinMoin/action/newaccount.py	2012-04-25 17:26:50.066917370 +0100
-@@ -12,7 +12,28 @@
+@@ -12,7 +12,29 @@
  from MoinMoin.security.textcha import TextCha
  from MoinMoin.security.sec_recaptcha import ReCaptcha
  from MoinMoin.auth import MoinAuth
 +from MoinMoin.mail import sendmail
++import subprocess
  
 +def _send_verification_mail(request, user):
 +    _ = request.getText
@@ -55,7 +56,7 @@
  
      # try to get the password and pw repeat
      password = form.get('password1', '')
-@@ -77,18 +108,41 @@
+@@ -77,18 +108,48 @@
      email = wikiutil.clean_input(form.get('email', ''))
      theuser.email = email.strip()
      if not theuser.email and 'email' not in request.cfg.user_form_remove:
@@ -87,10 +88,17 @@
 +
 +    # Send verification links if desired
 +    if request.cfg.require_email_verification:        
++        if request.cfg.external_creation_check:
++            create_error = subprocess.check_output([request.cfg.external_creation_check,
++                           theuser.name,
++                           theuser.email,
++                           theuser.account_creation_host])
++            if create_error:
++                request.theme.add_msg(_("Account creation failed: %s." % create_error), "error")
 +        mailok, msg = _send_verification_mail(request, theuser)
 +        if mailok:
-+            result = _("User account created! Use the link in your email to verify your account"
-+                       " then you will be able to use this account to login...")
++            result = _("User account created! Use the link in your email (%s) to verify your account"
++                       " then you will be able to use this account to login..." % theuser.email)
 +        else:
 +            request.theme.add_msg(_("Unable to send verification mail, %s. Account creation aborted." % msg), "error")
 +    else:
@@ -212,12 +220,14 @@
          else:
 --- a/MoinMoin/config/multiconfig.py	2012-04-22 18:17:14.000000000 +0100
 +++ b/MoinMoin/config/multiconfig.py	2012-04-23 14:26:10.035695888 +0100
-@@ -1040,6 +1040,8 @@
+@@ -1040,6 +1040,10 @@
  
      ('userprefs_disabled', [],
       "Disable the listed user preferences plugins."),
 +    ('require_email_verification', False ,
 +     "Require verification of new user accounts."),
++    ('external_creation_check', None,
++     "Name of external program to call for checking new account creation."),
    )),
    # ==========================================================================
    'various': ('Various', None, (
@@ -231,10 +241,12 @@
  
  try:
      import crypt
-@@ -355,6 +356,10 @@
+@@ -355,6 +356,12 @@
              self.id = self.make_id()
              if password is not None:
                  self.enc_password = encodePassword(password)
++            self.account_creation_date = str(time.time())
++            self.account_creation_host = self._request.remote_addr
 +            if self._cfg.require_email_verification:
 +                self.account_verification = uuid.uuid4()
 +            else:

Reply to: