开发者

Authlogic: How to block certain names and email addresses?

Using Authlogic, what's the proper way to ban certain usernames and domains (for email addresses)? The list if usernames and do开发者_开发技巧mains to block would be updated on an ongoing basis.

For instance, I don't want anyone to register with the username "admin" or "moderator" and I there are a slew of domain names I'd want to block from registering (for spam purposes).


See Active Record validates_exclusion_of.

class User
  validates_exclusion_of :username, :in => %w( admin moderator )
end
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜