[ic] UserDB.pm v2.52 - emails with numbers

Josh Lavin josh at myprivacy.ca
Thu May 24 11:15:08 EDT 2007


Josh Lavin wrote:
>
> die errmsg("Sorry, user name must be an email address.") . "\n"
>    if $self->{OPTIONS}{username_email}
> -    and $self->{USERNAME} !~ m!^[a-zA-Z]([.]?([[:alnum:]._-]+)*)?@ 
> ([[:alnum:]\-_]+\.)+[a-zA-Z]{2,4}$!;
> +    and $self->{USERNAME} !~ m!^[:alnum:]([.]?([[:alnum:]._-]+)*)?@ 
> ([[:alnum:]\-_]+\.)+[a-zA-Z]{2,4}$!;
>
> However, this does not seem to work. Now, when someone tries to  
> create an account with any email address, such as josh at hotmail.com,  
> it returns the error above. I had to go back to 2.51 to get any new  
> accounts to work at all.
>
> Any ideas on how to fix this?

Thanks to Jeff Boes, here is a diff from 2.52 for patching to make  
this work properly:

--- UserDB.pm.252       2007-05-13 17:30:25.000000000 -0500
+++ UserDB.pm   2007-05-23 10:47:08.000000000 -0500
@@ -1613,7 +1613,7 @@
                                 and $self->{USERNAME} =~ m!$self-> 
{OPTIONS}{username_mask}!;
                 die errmsg("Sorry, user name must be an email  
address.") . "\n"
                         if $self->{OPTIONS}{username_email}
-                               and $self->{USERNAME} !~ m!^[:alnum:] 
([.]?([[:alnum:]._-]+)*)?@([[:alnum:]\-_]+\.)+[a-zA-Z]{2,4}$!;
+                               and $self->{USERNAME} !~ m!^ 
[[:alnum:]]([.]?([[:alnum:]._-]+)*)?@([[:alnum:]\-_]+\.)+[a-zA-Z]{2,4} 
$!;
                 die errmsg("Must enter at least %s characters for  
password.",
                         $self->{PASSMINLEN}) . "\n"
                         if length($self->{PASSWORD}) < $self-> 
{PASSMINLEN};

--
Josh
Kingdom Design   http://www.kingdomdesign.com/




More information about the interchange-users mailing list