Lamps,

I believe using banned is the best way of doing it. You would cover 
multiple domains in the regex. 

The following snippet would ensure that addresses ending in gmail.com or 
hotmail.com fail registration...

auth_table.email.requires = [
  IS_EMAIL(error_message = auth.messages.invalid_email, banned = 
'^.*gmail\.com$|^.*hotmail\.com$'),  
  IS_NOT_IN_DB(db, auth_table.email)
  ]

regards,

Andy.


On Thursday, January 31, 2013 12:29:18 PM UTC, Lamps902 wrote:
>
> Hi, web2py users. Is there a preferred method for banning a set of email 
> domains from registering? I know that the IS_EMAIL() validator has a 
> "banned" parameter, but is this the best way to go about this task? If so, 
> is there a way to pass multiple domains to the "banned" parameter (I don't 
> think it accepts a list)? Also, is this: 
> ('^.*\domain_you_want_to_ban.com(|\..*)$') 
> a reasonable regex for this purpose? Thank you.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to