John Hurst | 8 Dec 2011 06:31

Re: Can I block people from creating accounts if they don't verify their address?

I had this problem.  I explored the web page below, but couldn't get it to work.

  http://moinmo.in/FeatureRequests/DisableUserCreation

Aftyer much trial and error, I eventually nurgled the _create_user routine in <your directory for python
packages>/MoinMoin/action/newaccount.py to add a couple of lines

def _create_user(request):
    _ = request.getText
    form = request.form

    if not request.user.isSuperUser():
        return _('You are not allowed to use this action.')

    ...

which does the trick by allowing only superusers to create new accounts.  However, it doesn't actually
print the error message, but internal errors, for reasons I don't understand.  Oh well, it was a simple fix. 
Perhaps someone else might explain what I'm doing wrong?

cheers,
--John Hurst
--5 Fran Court, Glen Waverley, VIC 3150                      ~ ~~~&#:
-- ajhurst <at> mac.com  +61 3 9803 9346              _..___  ---____ <at> ___H__
--(mob 0407 569 292)                             |_____[_|_________[__]_
-- http://homepage.mac.com/ajhurst/               oo oo  oo O--O--O o=o
--

-- 
-- If Christmas were all year round, what would you do?  Live to Party, or be a Party to Life?

On 20111208, at 15:37, Steven W. Orr wrote:
(Continue reading)

Steven W. Orr | 8 Dec 2011 16:05
Favicon

Re: Can I block people from creating accounts if they don't verify their address?

On 12/8/2011 12:31 AM, John Hurst wrote:
> I had this problem.  I explored the web page below, but couldn't get it to work.
>
>    http://moinmo.in/FeatureRequests/DisableUserCreation
>
> Aftyer much trial and error, I eventually nurgled the _create_user routine in<your directory for python
packages>/MoinMoin/action/newaccount.py to add a couple of lines
>
> def _create_user(request):
>      _ = request.getText
>      form = request.form
>
>      if not request.user.isSuperUser():
>          return _('You are not allowed to use this action.')
>
>      ...
>
> which does the trick by allowing only superusers to create new accounts.  However, it doesn't actually
print the error message, but internal errors, for reasons I don't understand.  Oh well, it was a simple fix. 
Perhaps someone else might explain what I'm doing wrong?

This is not really what I want. I don't want other people to not be allowed to 
create accounts. What I want is to prevent people from creating accounts whose 
email address matches a pattern. In my case (today) the interlopers are all on 
the .info TLD

Another thing that would be wonderful would be if the account creation could 
be completed only by responding to a confirmation email, the same as if you 
were signing up for a mailing list.

(Continue reading)

R.Bauer | 8 Dec 2011 17:05
Picon

Re: Can I block people from creating accounts if they don't verify their address?

Hi

read http://moinmo.in/HelpOnSpam and enable textchas

cheers
Reimar

Am 08.12.2011 16:05, schrieb Steven W. Orr:
> On 12/8/2011 12:31 AM, John Hurst wrote:
>> I had this problem.  I explored the web page below, but couldn't get it to work.
>>
>>    http://moinmo.in/FeatureRequests/DisableUserCreation
>>
>> Aftyer much trial and error, I eventually nurgled the _create_user routine in<your directory for
python packages>/MoinMoin/action/newaccount.py to add a couple of lines
>>
>> def _create_user(request):
>>      _ = request.getText
>>      form = request.form
>>
>>      if not request.user.isSuperUser():
>>          return _('You are not allowed to use this action.')
>>
>>      ...
>>
>> which does the trick by allowing only superusers to create new accounts.  However, it doesn't actually
print the error message, but internal errors, for reasons I don't understand.  Oh well, it was a simple fix. 
Perhaps someone else might explain what I'm doing wrong?
> 
> This is not really what I want. I don't want other people to not be allowed to 
(Continue reading)

Steven W. Orr | 8 Dec 2011 18:53
Favicon

Re: Can I block people from creating accounts if they don't verify their address?

On 12/8/2011 11:05 AM, R.Bauer wrote:
> Hi
>
> read http://moinmo.in/HelpOnSpam and enable textchas
>
>
> cheers
> Reimar

As I mentioned:

...it's also coming in despite TextCha being enabled. That never used to be 
the case.

>
> Am 08.12.2011 16:05, schrieb Steven W. Orr:
>> On 12/8/2011 12:31 AM, John Hurst wrote:
>>> I had this problem.  I explored the web page below, but couldn't get it to work.
>>>
>>>     http://moinmo.in/FeatureRequests/DisableUserCreation
>>>
>>> Aftyer much trial and error, I eventually nurgled the _create_user routine in<your directory for
python packages>/MoinMoin/action/newaccount.py to add a couple of lines
>>>
>>> def _create_user(request):
>>>       _ = request.getText
>>>       form = request.form
>>>
>>>       if not request.user.isSuperUser():
>>>           return _('You are not allowed to use this action.')
(Continue reading)

R.Bauer | 9 Dec 2011 09:53
Picon

Re: Can I block people from creating accounts if they don't verify their address?

Am 08.12.2011 18:53, schrieb Steven W. Orr:
> On 12/8/2011 11:05 AM, R.Bauer wrote:
>> Hi
>>
>> read http://moinmo.in/HelpOnSpam and enable textchas
>>
>>
>> cheers
>> Reimar
> 
> As I mentioned:
> 
> ...it's also coming in despite TextCha being enabled. That never used to be 
> the case.
> 

You can use a textcha only you can answer. Then only people in your
group which don't be annoyed by textchas can create accounts by the
newaccount action for others.

Reimar

>>
>> Am 08.12.2011 16:05, schrieb Steven W. Orr:
>>> On 12/8/2011 12:31 AM, John Hurst wrote:
>>>> I had this problem.  I explored the web page below, but couldn't get it to work.
>>>>
>>>>     http://moinmo.in/FeatureRequests/DisableUserCreation
>>>>
>>>> Aftyer much trial and error, I eventually nurgled the _create_user routine in<your directory for
(Continue reading)

Paul Boddie | 8 Dec 2011 23:00
Picon

Re: Can I block people from creating accounts if they don't verify their address?

On Thursday 08 December 2011 16:05:31 Steven W. Orr wrote:
>
> This is not really what I want. I don't want other people to not be allowed
> to create accounts. What I want is to prevent people from creating accounts
> whose email address matches a pattern. In my case (today) the interlopers
> are all on the .info TLD

Are they all providing .info e-mail addresses or are their requests 
originating from addresses resolving to .info domains? It seems to me that 
spammers could easily work around restrictions on e-mail addresses. 
Nevertheless, you could just change the newaccount action to check the e-mail 
address. Something like this, after checking for the address's presence for 
an existing user and just before saving the new user...

  blocked_pattern = getattr(request.cfg, "blocked_email_addresses")
  if blocked_pattern:
      blocked_regexp = re.compile(blocked_pattern)
      if blocked_regexp.match(theuser.email):
          return _("Couldn't register you!")

Feel free to use this, play around with it, use multiple patterns or whatever. 
I guess you'd set the pattern up like this:

  blocked_email_addresses = r".*?\.info$"

You could use the | operator and brackets to add more possibilities.

> Another thing that would be wonderful would be if the account creation
> could be completed only by responding to a confirmation email, the same as
> if you were signing up for a mailing list.
(Continue reading)

R.Bauer | 9 Dec 2011 09:55
Picon

Re: Can I block people from creating accounts if they don't verify their address?

Hi

just a note, moin2 approves accounts by email.

Reimar

Am 08.12.2011 23:00, schrieb Paul Boddie:
> On Thursday 08 December 2011 16:05:31 Steven W. Orr wrote:
>>
>> This is not really what I want. I don't want other people to not be allowed
>> to create accounts. What I want is to prevent people from creating accounts
>> whose email address matches a pattern. In my case (today) the interlopers
>> are all on the .info TLD
> 
> Are they all providing .info e-mail addresses or are their requests 
> originating from addresses resolving to .info domains? It seems to me that 
> spammers could easily work around restrictions on e-mail addresses. 
> Nevertheless, you could just change the newaccount action to check the e-mail 
> address. Something like this, after checking for the address's presence for 
> an existing user and just before saving the new user...
> 
>   blocked_pattern = getattr(request.cfg, "blocked_email_addresses")
>   if blocked_pattern:
>       blocked_regexp = re.compile(blocked_pattern)
>       if blocked_regexp.match(theuser.email):
>           return _("Couldn't register you!")
> 
> Feel free to use this, play around with it, use multiple patterns or whatever. 
> I guess you'd set the pattern up like this:
> 
(Continue reading)


Gmane