RjOllos <[email protected]> writes:

> For reference, solutions have been provided in:
> http://trac.edgewall.org/ticket/11803
> http://trac-hacks.org/ticket/12047 

For what it's worth, I've just had spam accounts created, despite the
AcctManager BotTrapCheck.  I wanted something like TracQuestionRegister,
but that no longer works.  I hacked up this change to the current
AccountManager to ask a project-specific question ("What's the command
to ...") which should be more robust.  I'll try to contribute it if
trac-hacks will talk to me sometime.

[The form you get from bottrap seems a bit odd to me.  The box is
labelled "Parole:" -- which is correct, but not a word I'd ever have
used for that -- rather than the "hint" which appears below, but I
didn't try to change it.  Also, it was unclear what the register_check
list could comprise and exactly how to customize things without the
admin GUI.]

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
--- acct_mgr/register.py	2014/11/05 15:16:40	1.1
+++ acct_mgr/register.py	2014/11/05 15:50:54
@@ -172,6 +172,8 @@
 
     reg_basic_token = Option('account-manager', 'register_basic_token', '',
         doc="A string required as input to pass verification.")
+    reg_basic_question = Option('account-manager', 'register_basic_question', '',
+        doc="A question to ask instead of the standard prompt, to which register_basic_token is the answer.")
 
     def render_registration_fields(self, req, data):
         """Add a hidden text input field to the registration form, and
@@ -182,11 +184,14 @@
             # everything again.
             old_value = req.args.get('basic_token', '')
 
-            # TRANSLATOR: Hint for visible bot trap registration input field.
-            hint = tag.p(Markup(_(
-                """Please type [%(token)s] as verification token,
-                exactly replicating everything within the braces.""",
-                token=tag.b(self.reg_basic_token))), class_='hint')
+            if self.reg_basic_question:
+                hint = tag.p(_("Please answer above: ") + self.reg_basic_question, class_='hint')
+            else:
+                # TRANSLATOR: Hint for visible bot trap registration input field.
+                hint = tag.p(Markup(_(
+                    """Please type [%(token)s] as verification token,
+                    exactly replicating everything within the braces.""",
+                    token=tag.b(self.reg_basic_token))), class_='hint')
             insert = tag(
                 tag.label(_("Parole:"),
                           tag.input(type='text', name='basic_token', size=20,

Reply via email to