ruby on rails - Authlogic: How to block certain IP addresses from signing up? -


using authlogic in rails app, want prevent users ip addresses sign (because of misuse). proper way that?

class signupscontroller < applicationcontroller   before_filter :block_ip_addresses    protected    def block_ip_addresses     head :unauthorized if current_ip_address == "xx.xx.xx.xx"   end    def current_ip_address     request.env['http_x_real_ip'] || request.env['remote_addr']   end end 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -